an
groups-icon

Using Membership Only Shortcode

Wait a minute... This content is very very old. We no longer sell or support this theme version. New Topics
  • Version 9
    Emanuele Pepe
    0 points
    Beginner

    In case you want to make more general things, u can add in the childtheme function file a function where only loged in users can see details,and adding the shortcode it hides it.

    like this :
    Function-php
    add_shortcode( ‘member’, ‘member_check_shortcode’ );

    function member_check_shortcode( $atts, $content = null ) {
    if ( is_user_logged_in() && !is_null( $content ) && !is_feed() )
    return $content;
    return ”;
    }

    add_shortcode( ‘visitor’, ‘visitor_check_shortcode’ );

    function visitor_check_shortcode( $atts, $content = null ) {
    if ( ( !is_user_logged_in() && !is_null( $content ) ) || is_feed() )
    return $content;
    return ”;
    }

    then use :

    [member]

    This is members-only content.

    [/member]

    [visitor]
    Some content for the people just browsing your site.
    [/visitor]

    I use this cause right now i only work with listings and not memberships… 🙂

    Good luck

    September 30, 2013 at 11:06 am
  • Jesse Fish
    0 points
    Beginner
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    March 17, 2014 at 7:06 am
  • Jesse Fish
    0 points
    Beginner
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    March 29, 2014 at 4:22 am
  • Richard Bonk
    -1 points
    Beginner
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    March 29, 2014 at 11:09 am
  • Jesse Fish
    0 points
    Beginner
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    March 29, 2014 at 8:18 pm
  • Richard Bonk
    -1 points
    Beginner
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    March 29, 2014 at 9:24 pm
  • Richard Bonk
    -1 points
    Beginner
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    March 30, 2014 at 10:26 am
  • Jesse Fish
    0 points
    Beginner
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    March 31, 2014 at 3:16 am

934

Views

22

Replies