教你在填写wordpress摘要时去掉p标签的方法-WordPress主题

摘要:大挖在wordpress仿站主题中临时遇到一个问题, 用以下代码调用wordpress内容摘要时,如果是自动调用那显示无…

大挖在wordpress仿站主题中临时遇到一个问题,
用以下代码调用wordpress内容摘要时,如果是自动调用那显示无问题,如果是手动填写摘要为会在代码中显示p标签。

那如果出现p标签在前台样式中就会出现一个换行的显示结果,这并不是大挖想要的,要大挖需要在wrodpress主题中设置一下当在wordpress后台填写摘要内容时,需要自动去掉p
这是什么原因呢:
在wordpress程序里有自己分段的设定,在可视化模式下执行一回车键,在html前台就会自动添加分段标签p,那大挖的情况就觉得p有点多余了,需要禁用p使用 wpautop() 对主题生效即可。
可以将下面代码复制到wordpress主题的functions.php 文件中

来源:http://www.wazhuti.com/1405.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_13175.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?