WordPress.org

Ready to get started?Download WordPress

Forums

Having issues highlighting some pages (1 post)

  1. TobyH
    Member
    Posted 2 years ago #

    For some reason I can't seem to get all of my pages to highlight the current page. The home and about pages seem to work fine, but not the others:

    http://www.nogymfitness.com

    Here is the code:

      <li<?php if ( is_page('no-gym-fitness')) { echo ' class="current_page_item"'; } ?>>HOME
      <li<?php if ( is_page('about')) { echo ' class="current_page_item"'; } ?>>ABOUT
      <li<?php if ( is_page('fitness-programs')) { echo ' class="current_page_item"'; } ?>>FITNESS PROGRAMS
      <li<?php if ( is_page('rates')) { echo ' class="current_page_item"'; } ?>>RATES
      <li<?php if ( is_page('press')) { echo ' class="current_page_item"'; } ?>>PRESS
      <li<?php if ( is_page('success-stories')) { echo ' class="current_page_item"'; } ?>>SUCCESS STORIES
      <li<?php if ( is_page('fit-blog')) { echo ' class="current_page_item"'; } ?>>FIT BLOG
      <li<?php if ( is_page('faq')) { echo ' class="current_page_item"'; } ?>>FAQ

    CSS:
    .current_page_item {
    color: #64101A!important;
    text-decoration: underline;
    }

    .current_page_item a, .current_page_item a:hover {
    display: block;
    text-decoration: underline;
    color: #64101A!important;
    }

    Any help would be greatly appreciated!!

Topic Closed

This topic has been closed to new replies.

About this Topic