Forums

Wordpress and the wrath of the <p> (5 posts)

  1. jnewing
    Member
    Posted 2 years ago #

    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?

  2. Sivar
    Member
    Posted 2 years ago #

    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.

  3. jnewing
    Member
    Posted 2 years ago #

    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.

  4. Sivar
    Member
    Posted 2 years ago #

    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.

  5. whooami
    Member
    Posted 2 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.