Support » How-To and Troubleshooting » Need with removing code from blog

Need with removing code from blog

  • I recently discovered that when I go to a couple of pages on my blog, the following text shows up in the upper left:


    It’s occuring on these pages:

    That text is found in the following code in my header.php:

    <div id="container"><?php if (is_page() && !is_page("archives")) echo " class=\"singlecol\""; ?>

    I don’t know enough about php to fix it myself, however, I do know that quotes and double quotes need to be handled with care.

    Anyone know what change I need to make? Thanks in advance!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Perhaps it should be
    <div id="container"<?php if (is_page() && !is_page("archives")) echo " class=\"singlecol\""; ?>>

    Hmm, the only difference I see is that you added a > at the end. I’ve never seen that before. Am I understanding you correctly?

    Well, actually I moved the PHP code inside the div tag. Then the PHP code will write that additional attribute inside the tag. Before it was writing the attribute outside.

    I gave it a shot, but the only result was that the > was posted to all my pages in the same location and the class="singlecol" remained. 🙂

    I was going to say that I think this started happening whenever I made a change to my header.php a while back (that change was not to the line of code referenced above). However, whenever I commented out the actual change, the text is still showing up, so I’m baffled.

    Any other ideas?

    Minnas code should have worked. It sounds more like you have added the > at the end but _missed_ to delete it before the opening <?php tag. So the > has to be _moved_, not _added_.

    That’s exactly what happened. The >> at the end is what stood out at me. Once I made the change the text went away.

    Thanks to you both! 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Need with removing code from blog’ is closed to new replies.