Different content for login/logout users

Hello,
I have been using two different static home page for logged in users (http://imgur.com/dBbrlf8) /logged out users (http://imgur.com/jzodOFB), but now I have came up with the problem that I have to make changes on two pages whenever there are some changes in homepage content.
So now I decided to move on to hide/show contents for logged in/logged out users by using the membership 2 pro plugin. I know there is shortcode for this but I don't know how to apply this shortcode in my site. Please render me some idea how to achieve this goal using membership 2 pro plugin
Thanks,
Austin

  • Jude
    • DEV MAN

    Hi there austin

    Hope all is well with you !

    Here is an example on using the shortcodes to protect content for different memberships / logged out users .

    Everybody can see this 
    
    [ms-protect-content id="1"] Only members of membership-1 can see this!	[/ms-protect-content]
    
    [ms-protect-content id="2,3" access="no" silent="yes"] Everybody except members of memberships 2 or 3 can see this!	[/ms-protect-content]

    Hope that clarifies

    Cheers
    Jude

  • austin
    • Site Builder, Child of Zeus

    Hello Jude
    This is great but the problem I am having is that how to apply this shortcode to show the price of tour and "book now" button for login users and "login" text for not login users. If it is plain text, I can apply this shortcode, but since the outcome is price for the tour and the button, I am quite confusing. Please understand my ignorance.
    Thanks,
    Austin

  • Luís
    • Support

    Hi austin ,

    Hope you're doing well today!

    I am not sure, but it's possible that you will need to change the theme code (or the function that displays the tour products).

    Can you give us access to your admin panel, so we can give a look?

    If you don't already know, please, follow the link below, to see how enable the staff login:

    http://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    When you enable this option, please post again!

    Cheers, Luís

  • Ivan Shulev
    • The Bug Hunter

    Hey austin ,

    I hope you are having a nice day so far!

    Can't you just use the core WordPress check for logged in users?

    Something in the lines of:

    if ( is_user_logged_in() ) {
    	echo '<button>Book now</button>';
    } else {
    	echo '<a href="/login">Login for Detail</a>';
    }

    I hope this helps and I wish you an awesome day ahead!

    Ivan

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.