instagram rss arrow-down

This shotcode allows you to write a private content in a post. For non-members, the login form will appear.

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

Code Snippet:

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' );

Source link

Support New Articles with a Sweet Tee

Leave a Reply
Your email address will not be published. Required fields are marked *

*

*