Support » Themes and Templates » Navigation — a class="current" issue

  • I am having problems with my navigation.

    class=”current” works when on Homepage and Categories only. Pages don’t seem to pickup the class=”current” echo.

    Can anyone see anything wrong with the code in my header.php

    I suck at PHP, any help much appreciated!!!!

    [code moderated per forum rules - please use the pastebin]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi boa,

    you might try replacing this code:

    <a href="<?php echo get_page_link($pageID);?>" <?php if ($page_id == $pageID || $pageID == $parent_id) echo "class='current'" ?>><?php echo get_the_title($pageID); ?></a>

    with this:

    <a href="<?php echo get_page_link($pageID);?>" <?php if(is_page($pageID)) echo 'class="current"';?>><?php echo get_the_title($pageID); ?></a>

    Thread Starter Mike

    (@boa)

    Thankyou sooooo much my man!!!

    Email me your Paypal I will buy you a beer.

    Haha, you’re welcome, my friend. Glad I could help you out 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Navigation — a class="current" issue’ is closed to new replies.