I am trying to use the sidebar on a page that is 4 levels deep. I only want to display the direct parent and the siblings in a dropdown list, but I cannot figure out how to do this. It seems it wants to go up 2 parent levels and I cannot limit it to just one. This is my structure:root/community/neighborhood/buildings/condo1 (condo2, condo3, etc.)
I only want to have a dropdown navigation with Buildings as the parent and condo1, condo2, condo3, etc. listed below the parent. Like this:
Buildings>Condo1>Condo2>Condo3
Please advise. Thank you.
Direct Parent and Siblings Only
Resolved
Richard Barnhart
I’m sorry, I’m not that good with code which is why I bought this plugin. So, I add this code to my functions.php file, then what? Does this give me more options with the plugin so I can do what I want?
OnPoint Plugins
Hi Richard,
The code automatically changes the menu output to do what you want. The majority of the widget options will still be supported. All page widgets will simply be limited to the 2 mentioned levels.
Have a great night!
Mat Lipe
OnPoint Plugins
Hi Richard,
This may be accomplished by adding the following filters to your active theme’s functions.php file:
This will only display the current page, it’s direct parent, and it’s siblings. Unless you are on a top level page, then it will display the current page and it’s first level children.
Have a great day!
Mat Lipe
Richard Barnhart
New problem. I have other menus that display the current page as the parent and then the children. You code broke those menus, so only the parent is displayed.
OnPoint Plugins
Hi Richard,
If you can provide me either a sidebar id or a widget id that you want to target specifically with the filters I can adjust them to only affect the one you would like. For this to work, the widget or sidebar must be unique enough to exclude your other ones.
If you prefer, you may send me a link through the Private Information and I will pull the id from your page’s markup.
Mat Lipe
Richard Barnhart
OK, thanks, and just to be clear, I need 2 types of menus:
1. Menu with current page on top with 1 level of children underneath.
2. Menu with direct parent page on top and siblings underneath.
Here are two IDs to target:
condo_sidebar_child
condo_sidebar_siblings
Thanks.
OnPoint Plugins
Good Morning,
Here is an updated filter which targets the two mentioned sidebars separately:
Richard Barnhart
This new code is still breaking my other menus and it isn’t working on the target IDs.
Richard Barnhart
I want to make sure we are on the same page about what I’m trying to accomplish, so here is a more detailed description of exactly what I need. This is a url from my site of the deepest page in the hierarchy with description of each menu I need.
community: display children (works with your default plugin)
pompano-beach: display current page and children (works with your default plugin)
cypress-isles: display parent page and siblings (works with your default plugin)
The problem starts with going further down the hierarchy. In this url I need two things to happen:
condos: display current page and children
sabbia-beach: display parent page and siblings
OnPoint Plugins
Hi Richard,
Changing the menu structure that much from level to level is currently not possible with available filters and options.
The only way I know to approach this is to have a separate widget that is used on only the Condos and children of Condos pages. This could be done one of the following ways:
If you decide to go with option 2, once you have the widget on the pages, I can get the widget id and the Condos page id from the page markup.
Have a great weekend!
Mat Lipe