You may already be familiar with membership WordPress plugins or a similar plugin. Usually people has something to shared with registered member suppose they give more information or features for some members. This trick can be But this we can do yourself without using the plugin. As explained by justintadlock, we can create own functions in functions.php file. The way is easy, open the functions.php file and then copy and paste the following function into the functions.php file.
function member_check_shortcode( $atts, $content = null ) {
if ( ( !is_user_logged_in() && !is_null( $content ) ) || is_feed() )
return $content;
return '';
}
add_shortcode( 'member', 'member_check_shortcode' );
How to use it is like this:
[visitor]
Some content for the people just browsing your site.
[/visitor]
You can use this function wherever you are in the blog. You can limit it to a few sentences or a whole article.