Forums

Comment fragment being inserted in page? (6 posts)

  1. perpetualjon
    Member
    Posted 3 years ago #

    I'm getting what looks like a comment fragment "-->" inserted in my site that's showing up through different themes. The default two themes that come with WP don't have it but the last two new themes I've installed both show this fragment in IE (it's still there in Firefox but it's ignored and not rendered there). If I view source on either IE or Firefox, I can find this comment code fragment in the page:

    <!--END #secondary .aside-->
    </div>-->
    <!--END #content-->

    Any ideas how to remove this bug? Or is this a problem with both of the themes I've installed? I get this same comment fragment in another theme in a different area but still shows up right above the beginning of the main content.

    Here's my test website

  2. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    Change them to:

    <!-- END #secondary .aside -->
    </div>-->
    <!-- END #content -->

    It's a bug in the theme(s).

  3. perpetualjon
    Member
    Posted 3 years ago #

    The same bug? I've crawled over all the code on both themes and can't seem to find a single unclosed comment. I'll zip up each theme and post them up here a little later if that might help...

  4. perpetualjon
    Member
    Posted 3 years ago #

    Looks like it happens when I try and "comment out" the sidebar. If I do this in the Main Index Template, it works for Firefox but not for IE. Any ideas how I can eliminate hide the sidebar cleanly without just deleting the code from the file?

  5. perpetualjon
    Member
    Posted 3 years ago #

    So this is strange. I have this code in the Main Index Template:

    <?php get_sidebar(); ?>

    ...and if I just change it to this:

    <!--<?php get_sidebar(); ?>-->

    I successfully removes the sidebar from the browser in Firefox. In IE, it is still there (along with that fragment of the commenting code). In the mean time, I've just deleged this line from the template file and that works but I'd rather not delete code unless I absolutely HAVE to. Any ideas why it works this way?

  6. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    If you want to stop the sidebar appearing on the home page, you could try using:

    <?php if( !is_home() && !is_front_page() ) get_sidebar();?>

Topic Closed

This topic has been closed to new replies.

About this Topic