• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
Foster Solutions (FSI)

Foster Solutions (FSI)

The Solution is in the Process

  • Home
  • What We Do
  • Case Studies
    • Databases/Automation Case Studies
    • GIS/Market Research Case Studies
    • Local Government Case Studies
    • FSI – crosspollination – examples
  • Articles

Highlighting static Home page menu

May 1, 2009 by tech guys

In WordPress, if you use the current_page_item class for your menus so you can highlight the menu item for that page, it won’t work for the home page if it is set to be a static home page and not the blog page.  To get around that, you have to hard code the home page and check if the current page is the front page, and if so, highlight the home page.

In style.css

<code>

#navlist li.current_page_item {
background:#d9531e;
color:#FFF !important;
}

In your header.php for the menu list.

<div id=”navcontainer”>
<ul id=”navlist”>
<?php if (is_front_page())  {?>
<li class=”current_page_item”><a href=”<?php bloginfo(‘url’); ?>”>Home</a></li>
<?php } else { ?>
<li><a href=”<?php bloginfo(‘url’); ?>”>Home</a></li>
<?php }?>
<?php wp_list_pages(‘title_li=’); ?>
</ul>
</div>

</code>

Category: WordPress

Showcase Your Agency

Give your agency, business, or brand the sharp image it deserves with Mai Reach theme from BizBudding.

Buy Mai Reach Now

About tech guys

Previous Post:vba code in PowerPoint to find text and format
Next Post:Jen Laird White

Ready to get started?

Client Survey

Please take this survey if you are interested in a new or modified website. We will assess and get back with you as soon as possible.


Finding Solutions

We work with you to make things faster, easier and better.

  • Facebook
  • LinkedIn

Sites

  • Home
  • Blog
  • About
  • Features
  • Contact
  • Marketing

Features

  • Home
  • Blog
  • About
  • Features
  • Contact
  • Marketing

Support

  • Home
  • Blog
  • About
  • Features
  • Contact
  • Marketing

Copyright © 2026 · Foster Solutions (FSI) · All Rights Reserved

Back to top