Customise the selected header item in wordpress - for wp_nav_menu()

Following on from my earlier post I have now updated the code to reflect the changes in wp_nav_menu(), basically it is still the same, add this section into your functions.php:

function sethead(,) {
	 = str_replace(' current_page_parent','',);
	 = explode("\n",);
	foreach( as ) {
		 = strpos(,'title="'..'"');
		//print ;
		if(===false) {
			 = ;
		}
		else {
			 = str_replace('"><a title="',' current_page_parent"><a title="',);
		}
		 .= "\n".;
	}
	return ;
}

Then use the following code for where your navigation would go:

 = wp_nav_menu(array('echo'=>false));
switch (get_post_type()) {
	case 'custom-type':
		 = sethead('Custom Type Area',);
	break;
	default:
		 = ;
	break;	
}
echo ;

The only difference with wp_nav_menu() is that you have to set the Title attribute in the wordpress back end.

Hope this helps!