If you are using ajax to load content onto the page, then use jQuery to add/remove the current-menu-item class from the menu item in question. Something like jQuery(‘#menu-item-8’).addClass(‘current-menu-item’). Don’t forget to use .removeClass() to take it off the “old” link…
ok, cool.
i ended up doing this:
$(function() {
$('#nav ul li a').click(function() {
$('#nav ul li a').each(function() {
$(this).removeClass('selected');
});
$(this).addClass('selected');
});
});
and then just style my .selected class in css
I’m new on jquery and ajax and I’ve been trying to solve this in different ways for three hours and I was getting desperate, it was so simple….. thanks so much!!!
how do I exactly paste the above mentioned code in the header area of the header.php ??