Jump to content
Sign in to follow this  
MatthewMarichiba

How to turn off the navigation hover text

Recommended Posts

Simon

@John titles in the navigation menu are generated by the core WordPress function wp_nav_menu() but it can be changed by filtering its output. The solution can be read here http://wordpress.org/support/topic/remove-titlewhatever-from-wp_nav_menu?replies=6 And the code to add to your child themes functions.php is `function my_nav_notitle( $menu ){` `return $menu = preg_replace('/ title="(.*?)"/', '', $menu );` `}` `add_filter( 'wp_nav_menu', 'my_nav_notitle' );`

Share this post


Link to post
Share on other sites
jbsolutios

Hi Pross I added this to my child theme's function.php here, but it doesn't seem to work still? Have I put it in the correct place please? Will this code stop SEO from working please? Thanks

	// ====================================================
	// = BASE FUNCTIONS - Where you should add your code  =
	// ====================================================
	
	function my_nav_notitle( $menu ){
	return $menu = preg_replace('/ title="(.*?)"/', '', $menu );
	
	}
	add_filter( 'wp_nav_menu', 'my_nav_notitle' );

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×