0
我想發佈短代碼的自定義帖子類型有功能添加新聞,但它只是繼續顯示短代碼本身,而不是短代碼內容。WordPress的短代碼在自定義帖子類型
在我的主題的functions.php的我已經加入:
add_filter('insertPages_init', 'shortcode_unautop');
add_filter('insertPages_init', 'do_shortcode');
,並在我的insertpages插件的功能如下:
function insertPages_init() {
add_shortcode('insert', array($this, 'insertPages_handleShortcode_insert'));
}
從自定義類型後製作後仍然只是打印短代碼而不是其內容。我可以得到它的工作,因爲我希望使用示例:
add_filter('widget_text', 'do_shortcode');
而且工作得很好。
如何讓我的自定義帖子類型接受簡碼?
嘗試調用'init'鉤子上的'insertPages_init'。 – SidFerreira 2015-04-01 09:15:24
https://wordpress.org/support/topic/enable-shortcodes-in-custom-post-types – bodi0 2015-04-01 09:16:49
嗨,對不起,即時通訊新的,我將如何去呢?謝謝 – darrrrUC 2015-04-01 09:17:09