Hide private content from non users with PHP Code snippet, You can restrict non members to see any of your private content. This short code allows you to write a private content in a post.

Usage:

[mem] ..content.. [/mem]

Add This code in your functions.php

function member( $atts, $content = null ) {
if  ( is_user_logged_in() && !is_null( $content ) && !is_feed() ) {
return $content;
return '';
} else {
$yonlendir = get_permalink();
$form = wp_login_form(array('echo' => false, 'redirect' => $yonlendir ));
return $form;
}
}
add_shortcode( 'mem', 'member' );