Last active
February 19, 2017 07:09
-
-
Save kirandash/ef8c169a2d40d3a4cce40191de13545b to your computer and use it in GitHub Desktop.
Remove current_page_parent from posts page link in WordPress nav menu
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 wpdev_nav_classes( $classes, $item ) { | |
| if( ( is_post_type_archive( 'fleet' ) || is_singular( 'fleet' ) ) | |
| && $item->title == 'Blog' ){ | |
| $classes = array_diff( $classes, array( 'current_page_parent' ) ); | |
| } | |
| return $classes; | |
| } | |
| add_filter( 'nav_menu_css_class', 'wpdev_nav_classes', 10, 2 ); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment