Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
Your theme doesn’t seem to be using the wp_nav_menu
function, so you cannot target current page items with those class names.
Use this class name, “current”.
I tried .current and it didn’t work. I tried using nav ul li current and it didn’t work either as well as a few other combinations.
So if I add the function from the twentytwelve them into my functions.php file for my theme, it should work, right? However, I dont know what to change the add_filter stuff too. Can you help? TYVM (^_^)
// This theme uses wp_nav_menu() in one location.
register_nav_menu( 'primary', __( 'Primary Menu', 'twentytwelve' ) );
/**
* Makes our wp_nav_menu() fallback -- wp_page_menu() -- show a home link.
*
* @since Twenty Twelve 1.0
*/
function twentytwelve_page_menu_args( $args ) {
if ( ! isset( $args['show_home'] ) )
$args['show_home'] = true;
return $args;
}
add_filter( 'wp_page_menu_args', 'twentytwelve_page_menu_args' );
You might want to use a theme that is more up-to-date and supported here (these forums only support themes from the repository on this site) – if you want a “blank” theme, look at Toolbox or BlankSlate.
Thank you I will look into Toolbox or BlankSlate.
If I get BlankSlate theme, will it do what I need it to do above?