Skip to content

Instantly share code, notes, and snippets.

@aiiddqd
Created May 13, 2017 10:39
Show Gist options
  • Save aiiddqd/37c8ad1f2426d53c76b5b6090ec58231 to your computer and use it in GitHub Desktop.
Save aiiddqd/37c8ad1f2426d53c76b5b6090ec58231 to your computer and use it in GitHub Desktop.
Меняем классы у меню WordPress
<?php
function wpc37174_special_nav_class($classes, $item){
if( is_single() && $item->title == "Blog"){
$classes[] = "special-class";
}
return $classes;
}
add_filter('nav_menu_css_class' , 'wpc37174_special_nav_class' , 10 , 2);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment