WordPress.org

Support

Dynamic Menu

  • I cannot get the active page link to be highlighted. It’s stuck on home.

    This is the code I am using in my header.php

    <div id="menu">
    		<ul>
    			<li class="page_item active<?php if (is_home()) echo ' 
    
    current_page_item'; ?>"><a href="<?php echo get_option('home'); ?>/">Home</a></li>
    			<?php wp_list_pages('title_li=' ); ?>
    		</ul>

    I have page_item active set as

    #menu li .page item active a {
    	background: #07B6FE;
    	color: #FFFFFF;
    }

    Can someone explain what I am doing wrong?

Viewing 1 replies (of 1 total)
  • Michael

    @alchymyth

    Forum Moderator

    your css is somehow faulty – corrected below:

    #menu li .page_item.active a {
    	background: #07B6FE;
    	color: #FFFFFF;
    }

    you could try styling the .current_page_item class

    #menu li .page_item.current_page_item a {
    	background: #07B6FE;
    	color: #FFFFFF;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Dynamic Menu’ is closed to new replies.
Skip to toolbar