WordPress.org

Ready to get started?Download WordPress

Forums

Creating code which is not there (4 posts)

  1. jami1955
    Member
    Posted 5 years ago #

    Hi wordpress,
    fabulous script, I love it, first bug I've found is:
    I am editing a page and have toggled the HTML tab so I can input html. I have two divs, one float left, one float right, they should sit side by side. At the bottom I have this code:
    <br class="clearBoth">
    This break is on the same line as the end div tag of the previous div, so there is no line break.
    WordPress however changes that to
    <p> <br class+"clearBoth"> </p>

    thus adding space and a paragraph where there should be none. Why is WordPress putting the paragraph tag in, and how can I stop it from doing that??
    Also, maybe someone should add the latest version (2.7) to the version drop down menu...
    thanks,

  2. Austin Matzko
    Member
    Posted 5 years ago #

    By default, WordPress formats post text with the wpautop() function, which adds paragraph tags. There are a number of plugins that allow you to control wpautop and the other formatting functions (just google it), or you can remove wpautop() with the following line:

    remove_filter('the_content', 'wpautop');

  3. jami1955
    Member
    Posted 5 years ago #

    Thanks, where would I put that line of code
    remove_filter('the_content', 'wpautop');

    ?

    JSC

  4. Austin Matzko
    Member
    Posted 5 years ago #

    In a plugin or in your theme's functions.php file.

Topic Closed

This topic has been closed to new replies.

About this Topic