Keep categories expanded on single post
-
When navigating to a post via the Nextend plugin, the categories fold once I’m on the post page. I would like the menu to remain unfolded when on the post, so the visitor can see in which (sub-)category he is. Is there a setting or change that can accomplish this?
-
Hi Boris!
I’m sorry, but we only have the option to open up the menuitem, where you are, and not the category of that post. But I will put this option into the to do list, because it sounds like a good thing, what others could use too.
Is there an update for this, since this is posted 6 months ago 🙂
Im testing accordion menus and cant find this option.
Thx
Could you do a quick test for me?
Open
wp-content\plugins\nextend-accordion-menu\types\wordpress\wordpress\menu.phpFind the following:
function find_active( $sorted_menu_items ){ .... .... return $sorted_menu_items; }and replace it with this one:
function find_active( $sorted_menu_items ){ $closestActive = null; foreach ( $sorted_menu_items as $menu_item ) { if ($menu_item->current) { $closestActive = $menu_item; break; }else if ($menu_item->current_item_parent ) { $closestActive = $menu_item; }else if (!$closestActive && $menu_item->current_item_ancestor ){ $closestActive = $menu_item; } } if($closestActive){ $active = new stdClass(); $active->id = $closestActive->ID; $active->parent = $closestActive->menu_item_parent; $this->active = $active; } return $sorted_menu_items; }Could you tell me if the result is good in your case?
Hey man, this works =)
Thx for fast help!Thank you for your confirmation! I will create an update tomorrow.
The topic ‘Keep categories expanded on single post’ is closed to new replies.