Created
May 13, 2017 10:39
-
-
Save aiiddqd/37c8ad1f2426d53c76b5b6090ec58231 to your computer and use it in GitHub Desktop.
Меняем классы у меню WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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