简体   繁体   English

WordPress的图像和P解析

[英]Wordpress image and p parsing

I have an image that should float right to the text, and it does, inside the main theme. 我有一个应该浮动到文本右侧的图像,并且确实在主主题内。 However in a mobile theme, the source code in the end is 但是,在移动主题中,最后的源代码是

<p> <img /> </p>
<p> TEXT </p>

instead of 代替

<p> <img /> TEXT </p>

Where and how could I fix this problem? 我在哪里以及如何解决此问题?

I am new to wp (i know php) and I am modifying themes someone else built, so I do not know too much. 我是wp的新手(我知道php),并且我正在修改别人构建的主题,所以我不太了解。 If this helps, the original theme is twenty ten and the mobile theme is called mobile pack base, so I guess I should see how the initial theme works and parses content, and then modify the mobile pack one, but I have no idea where to look 如果有帮助,原始主题为二十,移动主题称为移动包基础,因此我想我应该看一下初始主题的工作原理并解析内容,然后修改移动包一个,但我不知道在哪里看

The extra paragraph is probably being added by wpautop . 额外的段落可能是wpautop添加的。 You can disable it by adding the following to your functions.php file. 您可以通过将以下内容添加到functions.php文件中来禁用它。

remove_filter( 'the_content', 'wpautop' ); // Remove auto formatting in full content 
remove_filter( 'the_excerpt', 'wpautop' ); // Remove auto formatting in post excerpts

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM