WordPress.org

Ready to get started?Download WordPress

Forums

Dynamic Menu (2 posts)

  1. lalabirdbrains
    Member
    Posted 3 years ago #

    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?

  2. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    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;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic