Need with removing code from blog (7 posts)

  1. davincim
    Posted 9 years ago #

    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!

  2. Minna
    Posted 9 years ago #

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

  3. davincim
    Posted 9 years ago #

    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?

  4. Minna
    Posted 9 years ago #

    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.

  5. davincim
    Posted 9 years ago #

    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?

  6. McShelby
    Posted 9 years ago #

    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_.

  7. davincim
    Posted 9 years ago #

    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! :)

Topic Closed

This topic has been closed to new replies.

About this Topic