怎么去掉wordpress 文章摘要简介描述(the_excerpt)和文章内容(the_content) p标签
WordPress的内置函数中包括了:
the_excerpt(摘要输出)
1 | <?php the_excerpt("[Read more]"); ?> |
the_content(正文输出)
两个文章函数,但是以上标签在使用时会自动为其内容包裹
标签
在查阅了官方手册后发现有最新的解决办法
https://codex.wordpress.org/Function_Reference/wpautop
打开模板function,加入
1 2 | remove_filter( 'the_content', 'wpautop' ); //去除正文P标签包裹 remove_filter( 'the_excerpt', 'wpautop' );//去除摘要P标签包裹 |
来源:邦林织梦(微信/QQ号:909912499),欢迎分享本文,转载请保留出处!部分内容来自网络,如有侵权请联系删除处理!
本站提供代码修改,dedecms,WordPress仿站二次开发 / PHP网站建设以及SEO优化等网络营销推广等服务。
如有需要请加QQ: 909912499