admin管理员组文章数量:1391987
I'm using the remove_filter
in functions.php to remove the auto insertion of <p>
and <br>
tags on my wordpress site.
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
But one of our pages (wiki) is being dynamically created and to make a long story short, it relies on the <p>
tags.
How and where should I write an if
statement that targets only certain pages to apply the remove_filter
to?
I've tried placing this code in the both the functions.php, front-page.php, and page.php files but nothing seems to work.
<?php if ( !is_page( 'wiki') ) {
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
} ?>
本文标签: phpRemoving quotwpautopquot (auto ltpgt tags) only on certain pages
版权声明:本文标题:php - Removing "wpautop" (auto <p> tags) only on certain pages? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744749812a2623106.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论