Forums
Forums / Fixing WordPress / Dynamic Menu
(@lalabirdbrains)
15 years, 5 months 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?
(@alchymyth)
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; }
The topic ‘Dynamic Menu’ is closed to new replies.