• Hello,
    I’m having some problems with an altered Twenty Ten theme or perhaps wordpress in general. I have a lot of copied and pasted code into my pages and what was once clean and properly formatted code is showing up with line breaks where there shouldn’t be, it acts as if just because the sentence is on two lines, it actually has a
    but it doesn’t. Any suggestions on how to get rid of this?

    I have looked
    everywhere
    agh!

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Unless you provide a link to a page demonstrating the problem, no one will be able to offer much in the way of specific help.

    Thread Starter webtemplates

    (@webtemplates)

    Actually after taking another look at the code, i noticed that <br \> tags are getting added into the output code when it’s displayed in the browser and I view the source.

    Thread Starter webtemplates

    (@webtemplates)

    ok that took forever to find but alas.. /wp-includes/formatting.php
    this seemed to do the job:

    /**
    * Replaces double line-breaks with paragraph elements.
    *
    * A group of regex replaces used to identify text formatted with newlines and
    * replace double line-breaks with HTML paragraph tags. The remaining
    * line-breaks after conversion become <> tags, unless $br is set to ‘0’
    * or ‘false’.
    *
    * @since 0.71
    *
    * @param string $pee The text which has to be formatted.
    * @param int|bool $br Optional. If set, this will convert all remaining line-breaks after paragraphing. Default true.
    * @return string Text which has been converted into correct paragraph tags.
    */
    function wpautop($pee, $br = 0) {

    Try adding remove_filter('the_content', 'wpautop'); to your theme’s functions.php.

    Thread Starter webtemplates

    (@webtemplates)

    My solution was:

    http://www.benhuson.co.uk/wordpress-plugins/remove-white-space
    Remove White Space Plugin

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Whitespace & linebreaks’ is closed to new replies.