我正在使用插件喜欢阅读http://wordpress.org/extend/plugins/like-to-keep-reading/问题是当我将它们嵌入到我的站点时,它使用打开和关闭短代码http://vijaykudal.info 只显示开头短代码,你能帮我吗?PS:-也尝试了不同的主题
在主题内容中使用快捷码
2 个回复
最合适的回答,由SO网友:Eric Holmes 整理而成
要在PHP模板中放置短代码,请使用do_shortcode();
<?php
echo do_shortcode( \'[like_to_read]The text that is hidden from the user.[/like_to_read]\' );
?>
编辑: <?php
echo do_shortcode( \'[like_to_read]\' . get_the_content() . \'[/like_to_read]\' );
?>
SO网友:wassimo
my your theme Deactivated shortcode,因此此工具可以节省时间在文件夹中搜索有关shortcode remove word的内容。安装此工具后,单击主题文件并单击grepwin,然后编写remove\\u shortcode,然后等待查看resluts,如果有任何页面包含remove\\u shortcode,则会在下面的框中显示,您所要做的就是玩代码,祝一切顺利!或者您可以简单地使用此短代码
例如
function shortcode_content_post_url() {
echo \'short codes is cool\';
}
add_shortcode(\'cool\', \'shortcode_content_post_url\');
和在url帖子类型中[cool]
然后会显示短代码很酷
结束