WordPress.org

Ready to get started?Download WordPress

Forums

Navigation highlight (4 posts)

  1. kr3t3n
    Member
    Posted 5 years ago #

    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

  2. WizardRegis
    Member
    Posted 5 years ago #

    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 */ }
  3. spiritbased
    Member
    Posted 5 years ago #

    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>
  4. spiritbased
    Member
    Posted 5 years ago #

    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>

Topic Closed

This topic has been closed to new replies.

About this Topic