page menu entry for custom post type
page menu entry for custom post type
page menu entry for custom post type
Below is a walker class that will do just that. Add this to your functions.php file; class Description_Walker extends Walker_Nav_Menu { function start_el(&$output, $item, $depth, $args) { $classes = empty($item->classes) ? array () : (array) $item->classes; $class_names = join(‘ ‘, apply_filters( ‘nav_menu_css_class’, array_filter( $classes ), $item ) ); !empty ( $class_names ) and $class_names=” class=””. … Read more
This is probably what you are looking for .. add_filter( ‘wp_nav_menu_objects’, ‘add_menu_parent_class’ ); function add_menu_parent_class( $items ) { $parents = array(); foreach ( $items as $item ) { if ( in_array(‘current-post-ancestor’, $item->classes) ) { $parents[] = $item->menu_item_parent; } } foreach ( $items as $item ) { if ( in_array( $item->ID, $parents ) ) { $item->classes[] … Read more
add_action(“wp_footer”,”Stack_308520_hide_menu”); function Stack_308520_hide_menu(){ if(is_page(889 /*your page id*/){ ?> <style> nav.width-navigation {display:none}</style> <?php } } this is a pure css solution
How to combine multiple categories in one Menu item?
How to make next and previous button based on a menu
Sorting child item of navigation menu using code in wordpress
Tiles as a navigation
It sounds like the click event is being bound to your .menu-toggle button more than once. One possible fix is to unbind the click event first, but this is not ideal: $(‘.menu-toggle’).unbind(‘click’).click(function () {… https://stackoverflow.com/questions/3829871/slidetoggle-executing-twice-in-one-call A better solution would be to try and work out how the click event could be added twice? Also, it … Read more
If you use your custom Walker class, then there’s no point in using filters for adding these classes. Let’s take a look at this part of your code: $class_names = join( ‘ ‘, apply_filters( ‘nav_menu_css_class’, array_filter( $classes ), $item, $args ) ); $class_names = $class_names ? ‘ class=”‘ . esc_attr( $class_names ) . ‘”‘ : … Read more