I solved this by adding following function,
add_action('parent_file', 'keep_taxonomy_menu_open');
function keep_taxonomy_menu_open($parent_file) {
global $current_screen;
$taxonomy = $current_screen->taxonomy;
if ($taxonomy == 'directory_category')
$parent_file="directory";
return $parent_file;
}
If you are adding more taxonomies, just change if condition in above code like following
if ($taxonomy == 'directory_category' or $taxonomy=='tax2' or $taxonomy=='tax3)
Related Posts:
- Walker_Nav_Menu creating too many closing tags?
- Duplicate menu items when auto generating menu from product categories
- How to add a taxonomy type in Menus?
- Customizing Only a Specific Menu using the “wp_nav_menu_items” Hook?
- How make top level menu item not have link, but have sub-menus that are linked?
- Generate a Menu that Displays Child Pages using wp_list_pages() with the New Menu Functionality in WordPress 3.0?
- How Does The Walker Class Work?
- WordPress Shortcode in Menu Item Title
- Calling the Menu Title within wp_nav_menu array function
- How to stop mobile theme inheriting desktop navigation menu?
- How to hide an item from a menu to logged out users (without a plugin)
- Large WP 3.0 menu times out and won’t save
- How to apply a class to the second word in menu list item?
- How to switch between the Primary Menus programmatically?
- if role is logged in then do something
- WordPress wp_nav_menu within iFrame
- Generate a Menu that displays all child pages of top level parent
- Terms with more than one occurrence have current-menu-item class in menu
- Nav menu items disappearing (but not immediately)
- start_lvl on Walker is not working
- How to get Menu Navigation Labels to output HTML
- custom menu not found
- wp_nav_menu doesn’t generate parent/ancestor classes
- How to add text before WordPress menu item href
- Nav walker, bootstrap: Display 3rd level items under 2nd level
- Remove nav_menus from customizer using a theme
- Pending Custom Link in Menu
- Benefits of using Nav Walker?
- Social Links Menu displays icon instead of text (twentyfifteen) [closed]
- Add tabindex to navmenu
- wp_list_pages sort order is different for different languages [closed]
- has_children in custom nav_walker
- How do I remove the link element from the current page in a wp_list_pages menu?
- Altering html structure and creating custom menus
- How to construct a custom html for submenus
- JSON file export of nav menu
- How to generate a list of child pages, and use some of their custom fields?
- How to have two menus using Bootstrap nav walker?
- Generating wordpress menu – cant understand the config
- SlideDeck 2, make back-end visible for admins only
- How do I add (css) class to a custom link to make it current_page_item
- Limit amount of posts made within a custom taxonomy
- Display menu locations in all sites of a multi site
- Making a navigation header menu with bulma, need some advice
- From a page, is it possible to find entry’s “menu_item_parent”?
- WordPress menu link not working
- target nav class in wp_nav_menu
- How to retrieve parent menu item name of current submenu item
- Admin menu structure
- WordPress menu performance is slow when lot of items [closed]
- Create subpages in default WordPress menu
- Does is_child() exist in wp 3.5.1?
- Submenu page buttons are blank
- Main menu gets replaced when second menu is created
- Hide menu items if the page content is empty
- Output menu title
- Problem adding ‘has-children’ class to wp_nav_menu
- exclude pages in custom menu
- Adding new pages to Menu
- wp_nav_menu() | Outputting my own custom code using built in features
- How to reference argument data for wp_nav_menu() from functions.php
- Hamburger Menu not working on reduced browser size
- Creating menu always gives error A name is required for this term
- WordPress functions.php does not affect the theme menus
- Showing the same menu in multiple location
- Wp Nav Menu div containers
- wp_nav_menu with WP as pure CMS
- Simple form to add custom links to menu?
- Wrap wp_nav_menu output around option tags for select menu
- What’s the best way to customize the WordPress Menu Page (in admin)
- Making the menu toggled open on mobile devices Illustratr theme
- How to include second layer sub menu to Walker Nav?
- need help in wordpress navbar setup
- Add class to sub-menu from unrelated element
- How can I creat custom menu with bootstrap
- Restrict user to edit only edit a certain menu
- How do i make a custom top level dashboard menu item available for all users?
- Where is the source code in the console coming from?
- Migrate old blogroll to menus automatically
- Getting parent object_id of child menu items in WordPress menu
- How to remove a sub-menu using walker hooks/filters without relying on a custom walker?
- Calling wordpress menu outside ignores custom menu item
- Specific Page that convert Hyperlink to anchor in nav menu
- Next page link via the custom menu
- How can I make this custom design menu work in wordpress?
- Active menu item / category
- Add different span class to wp nav menu
- Menu not always using correct link
- Custom Menus and taxonomies
- Help with changing style of the extended menu drop down [closed]
- How we show pages in dropdown
- Menu support for touch devices
- WordPress Flyout Menus
- wp_nav_menu doesn’t show on index page
- Automatically add new posts to a specific menu name
- can anyone help me converting my static menu to wp_nav_menu I’am trying to add static menu item to WordPress Menu
- Elegant way of adding an CTA to a menu
- How to set menu Display location
- How to add custom menu to block theme?
- get menu name for the current displayed page