Wordpress Custom Menus

Joined
Dec 15, 2009
Messages
1,382
Reaction score
236
I'm having a huge problems with WordPress >< it's soooo frustrating gossssssh...here's my problem:
I need to add a specific class(.active) into a Menu(just one, eg: 'home') on every different pages. Which mean if you go to home.php, the Menu is going to add .active < class into the code of home < Navigation Menu

If you're in about.php, then the code will automatically generate .active class into about < NAV
The thing is I'm so confused about where to start >< the API and documentation are driving me craaaaaaaaaaaazy so I'm wondering if anyone who is great enough and know the solution to my problem, please REPPPPPPPPPPPPPPPPLY :d

ps I don't know what to Google >< athough I did, it didn't gave me the right answer
 
Thanks for the response, but I couldn't understand how it works
Code:
/*menu handler*/ $(function(){ function stripTrailingSlash(str) { if(str.substr(-1) == '/') { return str.substr(0, str.length - 1); } return str; } var url = window.location.pathname; var activePage = stripTrailingSlash(url); $('.nav li a').each(function(){ var currentPage = stripTrailingSlash($(this).attr('href')); if (activePage == currentPage) { $(this).parent().addClass('active'); } }); });

what's the meaning of Bootstrap?
 
Back