0

Thanks for taking the time to check this out. I know it's outdated, but I'm using Wordpress 3.2.1.

I have a Custom Home Page - where I created a Page for it and titled it as my Home Page with the custom URL.

I was hoping someone on here will know how to target the Custom page (whether by PHP, Javascript, etc), so that if it's on the home page, I can change the menu-item-225 to have a class of current_page_item.

On my header.php, I have the following code.

if (is_home()) {
        wp_nav_menu(array('depth'=>0,'menu_class' => 'mainNavigation','container_id' => 'navwrap','menu'=>'Main Menu','link_before'=>'<span class="navspanFront">','link_after'=>'</span>'));                   
        }
        else {
            wp_nav_menu(array('depth'=>0,'menu_class' => 'mainNavigation','container_id' => 'navwrap','menu'=>'Main Menu','link_before'=>'<span class="navspanFront">','link_after'=>'</span>'));                   
        }
  • You know that the support idea behind WP is only supporting the current version? – kaiser Jul 4 '12 at 1:07
0

Rather than adding a class, just add a second selector to your .current_menu_item style of .home .menu-item-225. Not ideal, but for a single case, I think it's completely appropriate.

(This assumes that you're using body_class() on your <body> element, but you should be doing that anyway.)

  • Thank you so much mrwweb - I didn't think about doing it this way. – Nina Jul 6 '12 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.