Support » Fixing WordPress » Freshy 2 Highlight problem with Category in Menu

  • Hi there,

    I’m having a problem trying to have my category ‘Glossary’ highlight while I’m on that page(category).
    I have installed the WP-Snap! plugin so that I can have a glossary on my site.
    Within the Freshy 2 theme, I have made a file called ‘category-36.php’.

    <?php get_header(); ?>
    
    	<div id="content">
    
    <?php /* If this is a category archive */ if (is_category()) { ?>
         <h2 class="pagetitle"><?php single_cat_title(); ?></h2>
    
         <?php } ?>
    
    /* Here is where I placed the WP-Snap! code */
    
    <?php if (function_exists('wp_snap')) { echo wp_snap('cat=36'); } ?>
    
    /* End of added code */
    
    <?php if (have_posts()) : ?>
    
    		<?php while (have_posts()) : the_post(); ?>
    
    <div class="clearer"></div>
    <div class="glossarypost">
    			<div class="post" id="post-<?php the_ID(); ?>">
    				<h2 class="glossary"><?php the_title(); ?></h2>
    
    				<div class="entry">
    					<?php the_content('<span class="readmore">'.__('Read the rest of this entry &raquo;',TEMPLATE_DOMAIN).'</span>'); ?>
    .....

    Also in the header.php file here is what I changed.

    .....
    <div id="menu">
    <div class="menu_container">
    <ul>
    <?php if ('page' != get_option('show_on_front')) : // no page has been chosen as frontpage ?>
    
    <li class="<?php if (is_home()) echo 'current_page_item'; ?>">
    <a href="<?php echo get_settings('home'); ?>">
    <?php _e($freshy_options['first_menu_label'],TEMPLATE_DOMAIN); ?>
    </a>
    </li>
    <?php endif; ?>
    <?php wp_list_pages('sort_column=menu_order&title_li='); ?>
    
    /* Here is where I placed more code to have it show up in the menu */
    
    <li class="<?php if (is_category(36)) echo 'current_page_item'; ?>"><?php wp_list_categories('include=36&title_li='); ?></li>
    
    /* End of added code */
    
    <?php if ($freshy_options['custom_menus']){foreach ($freshy_options['custom_menus'] as $custom_menu){ ?>
    <li>
    <a href="<?php echo $custom_menu['url']; ?>">
    <?php _e($custom_menu['label'],TEMPLATE_DOMAIN); ?>
    </a>
    </li>
    <?php
    
    ....

    The final result looks like this.

    When I click on the Glossary page, it comes up, but the ‘Blog’ page is still highlighted. I would like to have ‘Glossary’ highlighted when it’s on that category.
    Any help or feedback would be appreciated.

    Thanks!

  • The topic ‘Freshy 2 Highlight problem with Category in Menu’ is closed to new replies.