• Not sure if this was due to 2.9 upgrade or not.

    The HTML output from single.php is long lines of code. This breaks Google ad code.

    Other such code in the header and sidebars is fine. Also, if I put the ad code into a post (using normal non-WYSIWIG editing) it’s also fine.

    Example page:
    https://www.squarecirclez.com/blog/friday-math-movie-science-of-watchmen/2449

    (see the code starting at <div id="content"><div id="maincolumn">)

    The offending line with the broken Google code starts at:

    </ol> </div><br /><p class="postmetadata alt">

    Any ideas on why this is happening and how to stop it would be appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Can you explain what you are doing, exactly? Are you putting the javascript in a meta field?

    Thread Starter ZacN

    (@zacn)

    Thanks for replying. No – I’m adding it to single.php, just below where the posts finish (end of #post div).

    I have done the same sort of thing in the header.php and sidebar.php files with no problems. The HTML output is as expected for those 2 cases.

    But for single.php only, the HTML output is long lines where it seems the “\n” (unseen) line breaks (in the php file) have been deleted somewhere. The Google code breaks if it is on one line – it needs to be on separate lines after each “;”.

    My theme is based on Blue21, which is fairly conventional.

    I know I can add Google code into posts using a plugin, but I prefer to add it myself.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘HTML output is long lines – breaks javascript’ is closed to new replies.