Annoying validation killer (6 posts)

    Posted 10 years ago #

    Howdy, site in question is in my name (not entirely SFW)

    For the life of me I cannot find where this errant li tag is being included from.

    It's the code just before the "Pages" H2 in my sidebar. Something is throwing <li class="pagenav"> in there which causes it to fail validation (unnested tag).

    I can't find it in my theme's sidebar.php, page.php, index.php or the default theme's similar pages.

    Where is this coming from?

  2. peiqinglong
    Posted 10 years ago #

    You have to post up your sidebar code. I'm thinking there is a line in there somewhere, probably in the PHP code that has an li in it. I can't view the PHP source of your site and without seeing the PHP, it would be extremely difficult to trouble shoot it.

    Posted 10 years ago #

    <?php if (is_home()) { ?>
    <?php if (function_exists('wp_theme_switcher')) { ?>
    <?php wp_theme_switcher(); ?>
    <?php } ?>

    That is what's before it and this is the line that loads the Pages menu. If I remove this line it get rid of the error, but it also gets rid of my page menu :/

    <?php wp_list_pages('sort_column=menu_order&title_li=<h2>' . __('Pages') . '</h2>' ); ?> `

  4. peiqinglong
    Posted 10 years ago #

    I'm thinking maybe a plugin you have running that "accesses" the sidebar might be the culprit. Try deactivating your plugins to test...

  5. Kafkaesqui

    Posted 10 years ago #

    Try changing your wp_list_pages() to the following:

    <?php wp_list_pages('sort_column=menu_order&title_li='); ?>

    That'll remove the extra list tagging going on.

    Posted 10 years ago #

    Thank you Kafkaesqui, that fixed it.

Topic Closed

This topic has been closed to new replies.

About this Topic