• 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
    • Websites / Hosting
      • Author’s Sites
      • Boutique Websites
      • Corporate Websites
      • Open Source CMS
      • Quick and Dirty Websites
    • SQL Databases / VBA Automation
    • GIS / Market Research
    • Government/Planning
  • Case Studies
    • Databases/Automation Case Studies
    • GIS/Market Research Case Studies
    • Local Government Case Studies
    • FSI – crosspollination – examples
  • Clients
  • Articles
  • Contact Us

Highlighting static Home page menu

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>

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.

Sites

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

Features

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

Support

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

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

Back to top