Shortcode wordpress: Only member read conten

  • 1. Only member login can see your post.
  • 2. Not use plugin
  • Introduce:
  • – Open Functions.php in your Theme
  • - Paste this code: 
  • function ibt_member_check_shortcode( $atts, $content = null ) {
    if ( is_user_logged_in() && !is_null( $content ) && !is_feed() )
    return $content;
    return '';
    }
    add_shortcode( 'member', 'ibt_member_check_shortcode' );

Used when you post content
Your post on tag [member] .... [/member]
[member] 
Content ....ABCD
ABCD ....
[/member]

0 nhận xét Blogger 0 Facebook

Subscribe to: Posts (Atom)

 
Tech - Scien - Health - Computer - Economy - Trade - Cars - Auto - Story ©Email: tailieuchogiaovien@gmail.com. All Rights Reserved. Powered by Inluon.net
LINK:Bantintuvan|tailieusupham|khoahocsupham|SKKN hay|Soidiemchontruong|dayvahoctot|diemthivao10hoctrenmobile|tradiemthituyensinh|How to best|How to best|Loans-Cars-Auto|Free VPN-Free socks
Top