The following code is inserted into the function.php to enable the login user to view the article content, insert [members_only] [/menmbers_only] where each article needs to be viewed by the user.
But I use foogallery in the article after the short code, Foogallery can not display normally, ask how to solve?
[Members_only]
[Foogallery id= "141"] article published here still shows [Foogallery id= "141"], did not call the short code.
[/menmbers_only]
add_shortcode( ‘members_only’, ‘members_only_shortcode’ );function members_only_shortcode( $atts, $content = null ){if ( is_user_logged_in() && !empty( $content ) && !is_feed() ){return $content;}return ‘注册并购买课程之后才能学习哦~';}
Reply content:
The following code is inserted into the function.php to enable the login user to view the article content, insert [members_only] [/menmbers_only] where each article needs to be viewed by the user.
But I use foogallery in the article after the short code, Foogallery can not display normally, ask how to solve?
[Members_only]
[Foogallery id= "141"] article published here still shows [Foogallery id= "141"], did not call the short code.
[/menmbers_only]
add_shortcode( ‘members_only’, ‘members_only_shortcode’ );function members_only_shortcode( $atts, $content = null ){if ( is_user_logged_in() && !empty( $content ) && !is_feed() ){return $content;}return ‘注册并购买课程之后才能学习哦~';}
Return Do_shortcode ($content);