Forums

Navigation -- a class="current" issue (4 posts)

  1. boa
    Member
    Posted 11 months ago #

    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]

  2. datdesignguy
    Member
    Posted 11 months ago #

    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>

  3. boa
    Member
    Posted 11 months ago #

    Thankyou sooooo much my man!!!

    Email me your Paypal I will buy you a beer.

  4. datdesignguy
    Member
    Posted 11 months ago #

    Haha, you're welcome, my friend. Glad I could help you out :)

Reply

You must log in to post.

About this Topic