Adding widget to sidebar which contains current page's submenu

Need to insert the sub menu of the current page into the current page's sidebar.

Is this possible?

What I'm interested in developing would be a menu that looks like this:

menuItem1 => subitem1, subitem2

menuItem2 => subitem3, subitem4

Navigate to Item1 page where the sidebarA contains the menu links sub1, sub2.

Navigate to Item2 page, sidebarA contains menu links sub3, sub4.

Any suggestions on how to do this either programmatically or with a widget?

Thank you.

Topic sidebar widgets menus Wordpress

Category Web


If you want this to be dynamic, based on the page and the associated menu, then you may need to write some code, because as of this moment, I do not know of a theme or a plugin that would perform that function. However you can simulate it, through the creation of independent menus for the individual pages and by using a widget, place the code on a page by page basis.

I tend to like this plugin for such a purpose:

https://wordpress.org/plugins/widget-shortcode/

or a sidebar plugin controller, which also does the job:

https://lv.wordpress.org/plugins/woosidebars/

Sadly they have not updated this plugin for a few cycles, but I have do have clients that are still using it successfully.

Either way, the layout of the menu is changeable in the menu area. Just create a new menu item for each of the unique menus you want.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.