test membeships mode 'no membership/vistor' different from 'guest non-member'

when I use the test memberships function, the initial setting is 'no membership/visitor' but that's different (to the plugin) from 'guest non-member' which is not ideal. I specifically created a 'guest' membership so that I could differentiate content from visitors and logged-in members. I want to have one chunk of content (in the footer, using a shortcode) that shows to all visitors who are not logged in, and a different chunk of text (replacing the visitor chunk) that shows to people who are logged in. I don't understand why the plugin makes a differentiation between a non-logged-in visitor and a guest non-member and would like to know why that's done that way.

    Ash

    Hello @scwtech

    I have asked login details because, there is basically no difference when you introduce a guest membership and visitors, so I wanted to check. Guest membership should be created to give access to some protected content to the visitors.

    I want to have one chunk of content (in the footer, using a shortcode) that shows to all visitors who are not logged in, and a different chunk of text (replacing the visitor chunk) that shows to people who are logged in.

    You can do it differently. Please use the following code:

    function user_content_func( $atts, $content = '' ) {
    	$atts = shortcode_atts( array(
    		'logged' => 0
    	), $atts, 'user_content' );
    
            if( $atts['logged'] == 1 ){
                if( is_user_logged_in() ) {
                    return $content;
                }
            }else{
                if( ! is_user_logged_in() ) {
                    return $content;
                }
            }
    }
    add_shortcode( 'user_content', 'user_content_func' );

    You can add those codes in your functions.php in the theme, if you think your theme won’t be changed. Otherwise mu-plugins is the best solution. To use mu-plugins, go to /wp-content/ and find the folder with name 'mu-plugins'. If there is no folder in that name, then create a folder, name it 'mu-plugins', create a file inside that, give any name you like and paste the code in there. You don't need to activate that plugin. Mu-plugins means must use plugins, so it will be activated automatically always. If you use mu-plugins then add a php start tag at the beginning of the code.

    Then use the following shortcodes:

    [user_content logged="0"]
    For visitors
    [/user_content]
    [user_content logged="1"]
    For logged in users
    [/user_content]

    Hope it helps Please feel free to ask more question if you have any.

    Cheers
    Ash