Have you set up & added a custom menu?
Thread Starter
AMCD
(@amcd)
my bad:
<nav id="headnav">
<ul>
<li><a href="http://localhost/amc/products/">Products</a></li>
<li><a href="http://localhost/amc/services/">Services</a></li>
<li><a href="http://localhost/amc/locations/">Locations</a></li>
<li><a href="http://localhost/amc/contact/">Contact</a></li>
</ul>
</nav>
As you can see… pretty standard stuff… just wont output the class
No – that’s not a WordPress custom menu. See custom menus.
Thread Starter
AMCD
(@amcd)
Yup…. this is being generated by a custom menu
Functions.php:
if ( function_exists( 'register_nav_menus' ) ) {
register_nav_menus(
array(
'headernav' => __( 'Header Navigation' ),
'footernav' => __( 'Footer Navigation' )
)
);
}
Calling in template:
<nav id="headnav">
<?php wp_nav_menu( array( 'theme_location' => 'headernav') ); ?>
</nav>
The code you listed above is not being generated by wp_nav_menu().
Thread Starter
AMCD
(@amcd)
Your right… I did some digging and found this in my functions.php
function remove_css_selector_attributes($input) {
return preg_replace('/ (id|class)=\"(.*?)\"/', '', $input);
}
add_filter( 'wp_nav_menu', 'remove_css_selector_attributes' );
Added by the original author of the blank theme template I’m using… in order to clean up the garbage classes WP ads to the menu code I presume.
Thanks for your help!