• I have a design for one of my pages that is fine as an HTML page – the CSS worked fine. But the same page content and CSS is messed up as one of my WP pages. I’m getting extra <p> tags added which are empty and getting a <p> tag added around a button link.

    Why would this be happening and how can I remove the paragraph tags that I didn’t add?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The Classic editor calls wpautop https://developer.www.ads-software.com/reference/functions/wpautop/
    but the block editor does not.

    Thread Starter Jim

    (@kernix)

    It doesn’t seem to do it for blog posts though. I removed it but I lost the margins or padding in between paragraphs on posts, so I used this in my functions file:

    // Stop WP adding extra <p> </p> to your pages' content
    if (is_page()) {
    	remove_filter( 'the_content', 'wpautop' );
    }

    That seems to fix the problem on pages without affecting my posts. Does that look fine to you? Okay to have that in my functions.php file? Thanks for the quick reply – I forgot about the wpautop thing.

    Okay to have that in my functions.php file?

    Whatever, it’s your site.
    But if you are making a theme to distribute, then no, you can’t do that. The theme should work regardless of the markup.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Did the recent update to WP do something with images’ is closed to new replies.