Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress can';不要让短代码在小部件中工作_Wordpress_Shortcode - Fatal编程技术网

Wordpress can';不要让短代码在小部件中工作

Wordpress can';不要让短代码在小部件中工作,wordpress,shortcode,Wordpress,Shortcode,我有一个非常严重的问题…我正在使用骨架wordpress主题作为框架来制作一个子主题。 “我的孩子”主题除了短代码外效果很好。 如果我在页面中插入一个短代码,一切正常,但是如果我在文本小部件中插入相同的短代码,它就不工作了 我已经尝试在functions.php中插入以下代码: add_filter('widget_text', 'do_shortcode'); add_filter('the_excerpt', 'do_shortcode'); add_filter('get_the_exce

我有一个非常严重的问题…我正在使用骨架wordpress主题作为框架来制作一个子主题。 “我的孩子”主题除了短代码外效果很好。 如果我在页面中插入一个短代码,一切正常,但是如果我在文本小部件中插入相同的短代码,它就不工作了

我已经尝试在functions.php中插入以下代码:

add_filter('widget_text', 'do_shortcode');
add_filter('the_excerpt', 'do_shortcode');
add_filter('get_the_excerpt', 'do_shortcode');
但是没有任何改变…我也尝试直接在模板文件中插入短代码 比如:


<?php echo apply_filters('the_content',"[latest excerpt='true' thumbs='true' width='50' height='50' num='5' cat='1']"); ?>