阻止Wordpress在段落标记中包装图像
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了阻止Wordpress在段落标记中包装图像相关的知识,希望对你有一定的参考价值。
Wordpress by default wraps images in <p> tags, this kills that.
// stop wordpress from wrapping images in <p> tags function filter_ptags_on_images($content) { // do a regular expression replace... // find all p tags that have just // <p>maybe some white space<img all stuff up to /> then maybe whitespace </p> // replace it with just the image tag... } // we want it to be run after the autop stuff... 10 is default. add_filter('the_content', 'filter_ptags_on_images');
以上是关于阻止Wordpress在段落标记中包装图像的主要内容,如果未能解决你的问题,请参考以下文章