Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End HELP !!Current_page_item nav wp_list_pages wordpress help

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #28958
    hal8
    Member

    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

    #75337
    hal8
    Member

    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)
  • The forum ‘Back End’ is closed to new topics and replies.