• Resolved coope

    (@coope)


    I need to post HTML code as the_content for static pages on my website. At least until I can automate some of the code. There are several pages with <p> tags which must be there to ensure paragraph formatting.

    What I definitely don’t need is wordpress automatically inserting its own <p> tags, and consequently breaking my pages.

    The only thing my research churns up is to use remove_filter( 'the_content', 'wpautop' );. Currently I am using this, because the pages look better with paragraphs jumbled together than the graphical layout being utterly stomped by unexpected spacing.

    How can I disable the p tag insertions by wpautop, and keep my own p tags?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Are you wrapping your HTML in <pre> tags? The wpautop function should “skip past” anything contained inside those.

    Thread Starter coope

    (@coope)

    I tried doing that, but the template css files I am using have a style for the pre tag hidden away.

    I actually found a solution earlier on this forum. I had been looking for the wrong key words the last day and a half. I can’t remember exactly the google search query I made, but it was auto formatting centric instead of specifically regarding the p tag or wpautop and its job.

    Here’s the link.

    It is the same idea as <pre> but with <div>. The thread suggests to enclose all the paragraphs with it, but I found it only worked on a individual basis.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove p tag *insertion but keep html p tags’ is closed to new replies.