Grow your CSS skills. Land your dream job.

HELP !!Current_page_item nav wp_list_pages wordpress help

  • # May 9, 2010 at 6:41 am

    Hi

    Can anyone please help me out. I am trying to have my nav so its got an active state when on that page. I am using wp_list_pages for my nav. I know how to do this on a static site but not on WordPress.

    Can anyone help me out on this one ?

    Cheers

    # May 11, 2010 at 5:43 am

    Ok so ive managed to do it kind of !!

    But when i use wp_list_pages(‘exclude=blah, blah, blah’) it seems to add an extra div automatically call pagenav

    Check out the pics. One is with <?php wp_list_pages(‘sort_column=menu_order&title_li=’); ?> and the other is the exclude.

    Does any one know what i have done wrong ?

    Here is my code

    <div id="main-nav">
    <ul>
    <li<?php if (is_home()){echo " class="current_page_item"";}?>><a href="<?php bloginfo(‘url’) ?>" title="Home">Home</a></li>
    <?php wp_list_pages(‘sort_column=menu_order&title_li=’); ?>
    </ul>
    </div>

    and css

    /* MAIN NAV */

    #main-nav {
    float: left;
    margin-top: 5px;
    z-index: 70;
    border: px dashed green;
    }

    #main-nav ul li {
    display: block inline;
    }

    #main-nav ul li a {
    color: #FFF;
    padding: 5px 10px;
    }

    ul#smain-nav li a:hover, #shome li.home a {
    border-bottom: 5px solid #FFF;
    color: #008EB1;
    }

    #main-nav ul li a:hover, #main-nav ul li.current_page_item a {
    border-bottom: 5px solid white;
    color: #008eb1;
    }

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".