• I have turned off “Use the visual editor when writing” so when I post I would like full control over the HTML, also I turned off “WordPress should correct invalidly nested XHTML automatically”

    However… WordPress still decides that a <p> tag is necessary on everything i put in that editor :/ now i could see generally how this would not be a problem, BUT, I want to put a <div> in there and WordPress decides that it will wrap <p> around it now we have problems…

    Is there any way I can stop this short of doing some hunting and hacking of code?

Viewing 4 replies - 1 through 4 (of 4 total)
  • I don’t know a way to change that, but why would you want to?

    If you don’t like the margins of the p-tag, feel free to change them. Let’s say, your posts are being displayed within in <div class="post"><p>*post-content*</p></div>… in that case you could add something like .post > p { margin: 0; } to your css-file.

    Thread Starter jnewing

    (@jnewing)

    yah but again if i want to put a div in there it now becomes invalid markup you can’t have <p><div> :/ thats why i would want to change that.

    And again, why would you want to put divs in there? Just for your sense of aesthetics and because you hate p-tags, or is there some reason why you really need it? If the latter, maybe there’s another workaround, which would not require a div.

    you can turn off wpautop completely if you like .. theres a few plugins that do it or you can just edit default-filters.php

    assuming you are using 2.2:

    add_filter('comment_text', 'wpautop', 30); // comments
    add_filter('the_content', 'wpautop'); // content

    just comment those out as you see fit.

    There is also a text control plugin that lets you do this on a post by post basis and also lets you use textile, etc..

    You’ll have to hunt around for the plugins,

    keywords:
    disable wpautop
    text control plugin for wordpress

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WordPress and the wrath of the <p>’ is closed to new replies.