Jump to content

Setting Menu List Item Class in WordPress


tonsils

Recommended Posts

Hi,

 

I am using WordPress and have created a menu system with the following setup that I have placed in my sidebar.php file

            
  <ul id="menu_sys">          
       <li><a href="a.php" class="currentM">Option A</a></li>
       <li><a href="b.php" class="">Option B</a></li>
  </ul>

 

My question is, at startup, my menu Option A is my current active menu, which is all great. But when I press on menu Option B, how can I pass into b.php or just setup in b.php, to now make menu Option B my current active menu, i.e. I need to set the class for Option B to current but unsure how to do this in PHP.

 

Would really appreciate some help as I'm working on a project that is due really soon.

 

Thanks.

TT.

 

ps I don't want to use wp_list_pages() function as it doesn't cater for my needs.

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.