在function.php中插入了如下代碼實現登陸使用者才能查看文章內容,在每篇文章需要登陸使用者查看的地方插入[members_only] [/menmbers_only].
但是我在文章中使用FooGallery的短碼後,FooGallery無法正常顯示,請教如何解決?
[members_only]
[foogallery id="141"] 文章發布後這裡還是顯示[foogallery id="141"],並未調用短碼。
[/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 ‘註冊併購買課程之後才能學習哦~';}
回複內容:
在function.php中插入了如下代碼實現登陸使用者才能查看文章內容,在每篇文章需要登陸使用者查看的地方插入[members_only] [/menmbers_only].
但是我在文章中使用FooGallery的短碼後,FooGallery無法正常顯示,請教如何解決?
[members_only]
[foogallery id="141"] 文章發布後這裡還是顯示[foogallery id="141"],並未調用短碼。
[/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);