Get "post ancestor" based on its ancestor in custom menu
-
Hello,
Yep the title is pretty obscure so I’m going to explain. Basically I’m trying to remix the dimox breadcrums code to make it work using custom menu order.
I’ve got a very complex menu, using categories, pages and custom-post-types, so the breadcrum trail is very hard to build. I was looking for a plugin that would be able to build a breadcrum based on the custom menu but found none. So I’m trying to build it myself.
For example I’ve got:
– page#1
– taxonomie archive #1
– taxonomie archive #2
– page#2
– category#1
– category#2I would like my breadcrums to be able to display something like home > page#1 > taxonomie archive #1 when I’m on taxonomie archive #1
I was wondering if there was a way to get the ancestors of my post (post used as a general word, they are actually pages, category/taxonomy archives, etc)not based on the wordpress order, but based on the “order” I would give them in custom menu.
There should be something possible, since wordress is able to give menu items the “current-menu-ancestor” class to a page for example even if it is not related to the post defined as its child in the custom menu. So I think that wordpress is able to find the “custom menu ancestor” (let’s call it this way), I just have no idea how to do this ^^
If anybody has a little peace of code to do this, I would appreciate the help (or a plugin able to create breadcrums based on custom menus)Thank you ??
- The topic ‘Get "post ancestor" based on its ancestor in custom menu’ is closed to new replies.