WordPress指定文章中不显示短代码的方法
如果准备在某篇文章中不显示短代码,可以将下面代码添加到当前主题函数模板functions.php中:
function remove_shortcode_from_index( $content ) {
if ( is_single( array( 123 ) ) ) {
$content = strip_shortcodes( $content );
}
return $content;
}
add_filter( 'the_content', 'remove_shortcode_from_index' );
修改其它中的数字123为文章ID。
版权声明:本文由 鹿泽笔记 原创发布。
本文链接:https://www.bailuze.com/15688.html
许可协议:本文标题《WordPress指定文章中不显示短代码的方法》,转载请注明文章出处及原始链接。
