[Membership 2 Pro] Shortcode prompting user to subscribe in order to read full post

Looking for Shortcode prompting user to subscribe in order to read full post. Is that available? I'm not seeing it in the shortcode tab of Membership PRO.

Thanks.

  • Predrag Dubajic

    Hi Robert,

    Hope all is well :slight_smile:

    You can use [ms-protect-content] shortcode to hide part of your page/post, it would look like this:

    This here will be visible to everyone!
    
    [ms-protect-content id="1"]
    Only members of membership with ID 1 can see this!
    [/ms-protect-content]

    It will look like this on the front end:

    You can also add login form shortcode if you want to show login on the page as well, like this for example:
    [ms-membership-login title="Login to see full content" autofocus="no"]

    More info about these shortcodes is available under Membership 2 > Help > Shortcodes panel.

    Best regards,
    Predrag

  • Robert

    Thanks so much for the info. That worked perfectly.

    One more thing. I'm trying to show only 1 type of membership in the
    [ms-membership-login title="Login to see full content" autofocus="no"] section for this instance.

    I'm not finding a m2-memberships.php file for this customization:

    Membership List Page
    1. m2-memberships-100.php (Not the list, only checkout for Membership 100)
    2. m2-memberships.php
    3. Default single-page template

    I think I need to be able to add this info to the child theme, correct?

    Thanks again for all your help.

  • Predrag Dubajic

    Hi Robert,

    Glad to hear that worked :slight_smile:

    However, I'm not sure that I understand your last question.
    The templates you are referring to will not affect what the shortcode is rendering, it can only be used to change page template.
    For example, in M2 > Settings you have SamplePage selected as Membership List page, this page will render as default single page, or page.php file in your theme.
    Now, let's say that your page.php file uses sidebar but you don't want it on your Membership List page.
    In order to do this you would create m2-memberships.php in your child theme, paste the code from page.php and edit it so it doesn't use sidebar.

    So could you give me some more info about this and tell me where exactly are you looking to show only one membership?

    Best regards,
    Predrag

  • Robert

    In the Membership2 'help' page, under 'customize membership 2' (http://mrrwebdev01.org/wp-admin/admin.php?page=membership2-help&tab=branding), it shows:

    Membership List Page
    1. m2-memberships-100.php (Not the list, only checkout for Membership 100)
    2. m2-memberships.php
    3. Default single-page template
    ---
    I'm trying to use option 1 - (Not the list, only checkout for Membership 100)
    Just need to know how to do that - shortcode options maybe?

    Thanks.

  • Predrag Dubajic

    Hi Robert,

    I'm afraid that those are not "options", it's order of which template will be loaded for the Membership List page, the one you select in M2 settings:

    So when someone goes to Membership List page it will load templates in that order.
    If you have m2-memberships-100.php in your child theme it will load checkout for membership with ID 100.
    If that file is not in your child theme then it will search for m2-memberships.php and load that.
    If neither of the above files are present in the child theme then it will use Default single-page template aka page.php.

    If changing Membership List template is what you're looking for then you would need to create m2-memberships-100.php in your child theme and change 100 to ID of the membership that you want to show.
    Then you need to paste the code from page.php in that new file and save the changes.

    You should now have a page that loads only that membership set by the ID.

    Best regards,
    Predrag

  • Predrag Dubajic

    Hi Robert,

    That shortcode should show log out link if you're logged-in, are you looking to hide that as well?

    We can do that by wrapping that shortcode with protection shortcode like this:

    [ms-protect-content id="5,10" access="no" silent="yes"]
    [ms-membership-login title="Login to see full content" autofocus="no"]
    [/ms-protect-content]

    In that shortcode you would need to change the IDs from 5 and 10 to your membership IDs.
    You can also see that there's access=no and silent=yes parts in there.
    What this means is that memberships with ID of 5 and 10 will not have access to login shortcode but since there's also silent=yes it will not show any message that there's something they don't have access to.

    So that should do the trick for you :slight_smile:

    Best regards,
    Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.