WordPress.org

Support

Support » Themes and Templates » Navigation highlight

Navigation highlight

  • Hi,

    i’m using the UnStandard theme but I can’t seem to manage one thing – I want some kind of hightlighting of the page the user is currently.
    I mean – to indicate some how on the categories bar or something – how can I indicate where is the user now? My site is momzo.com

    Thanks in advance

    Georgi Pepelyankov

Viewing 3 replies - 1 through 3 (of 3 total)
  • I guess you are using a custom menu, because it’s supported in the wp_list_pages function.

    XHTML

    <ul id="menu">
    	<?php wp_list_pages('depth=1&title_li=');?>
    </ul>

    CSS

    #menu li.current_page_item a { /* the active page */ }

    As for the categories I found out the active category get current-cat class so that should take care of that styling too.

    .current-cat { /* the active cat */ }

    This is cool, but I have a slight problem implementing it in my menu.

    I have a custom menu with a link to a category template. The other two pages highlight fine when current, but not this category template. Any ideas? Code below.

    <ul id="menuenu">
    <?php
    wp_list_pages('depth=1&sort_column=menu_order&title_li='); ?>
    <li><a href="<?php bloginfo('url'); ?>/?cat=62">Portfolio</a></li>
    </ul>

    Whaddya know, I figured it out…

    <ul id="menuenu">
    		<?php
    		wp_list_pages('depth=1&sort_column=menu_order&title_li='); ?>
    		<li class="page_item <?php if (is_category('62')) { echo "current_page_item"; }?>"><a href="<?php bloginfo('url'); ?>/?cat=62">Portfolio</a></li>
    		</ul>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Navigation highlight’ is closed to new replies.
Skip to toolbar