Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breadcrumbs based on nav menu hierarchy rather than page hierarchy #167

Closed
GermanKiwi opened this issue Aug 13, 2013 · 11 comments
Closed

Breadcrumbs based on nav menu hierarchy rather than page hierarchy #167

GermanKiwi opened this issue Aug 13, 2013 · 11 comments

Comments

@GermanKiwi
Copy link

I have an enhancement request regarding the breadcrumbs feature.

Currently, the breadcrumbs are based on the page hierarchy.

I'd love to be able to use breadcrumbs based on the navigation menu hierarchy (as defined in "Appearance > Menus"), ie. using "wp_nav_menu".

The menu hierarchy is quite different on my website. Most of my pages are located directly off the root URL (eg. example.com/pagename), which I prefer for the sake of having shorter URLs, but my menus place many of those same pages 2-3 levels deep, because that makes more sense for the menu navigation.

I'd like the breadcrumbs to therefore reflect the menus, not the actual page hierarchy. Otherwise, the breadcrumbs would all just be one level deep, like "Home > Page Name", which isn't helpful to the user.

Is this something that the plugin could impliment? Maybe some kind of switch to toggle between using the page hierarchy vs. the menu hierarchy?

@GermanKiwi
Copy link
Author

Hi, just wondering if this suggestion is a likely candidate for eventual implementation, or is it outside the scope of this plugin? In which case should I close it? (It doesn't have the "Enhancement" tag yet).

@Rarst
Copy link
Contributor

Rarst commented Jun 20, 2015

I think this would be very elaborate feature to implement for what sounds like a niche case to me.

@jdevalk opinion?

@Rarst Rarst self-assigned this Jun 20, 2015
@GaryJones
Copy link
Contributor

I think that would be a good case for a Extension (free / premium) or Yoast SEO Premium feature that would add a UI for creating custom breadcrumb trails to be used for individual pages, with a fallback to the defaults.

@GermanKiwi
Copy link
Author

I would not have thought this feature would be so elaborate to implement - and I'd be surprised if there weren't other users who had a similar page/menu setup to me, whereby the page URLs have a different structure to the menu hierarchy.

There is actually a plugin on Code Canyon that claims to do exactly this:
http:https://codecanyon.net/item/wp-nav-menu-breadcrumbs/4706192

However I'd much rather be able to use WP SEO to achieve this, so as to keep the number of installed plugins to a minimum, and especially when WP SEO already handles breadcrumbs. And in addition, the Code Canyon plugin hasn't been updated in over a year. But maybe the coding that it uses can give you an idea of how you could add it to WP SEO?

@Rarst
Copy link
Contributor

Rarst commented Aug 4, 2015

I would not have thought this feature would be so elaborate to implement

Had you seen the internals of WP menu code? :)

I am not saying this is super complicated, but I'd reason there needs to be pretty serious demand for it to consider as a feature. Not up to me to be clear, waiting for second opinion.

@GermanKiwi
Copy link
Author

Yeah, I understand the menu code is complex! :) I just figured, if this other guy has created a plugin that does it, maybe it's not that difficult to implement, given that there are already existing filters for the menu like wp_nav_menu which could be used (and I apologise if I don't know what I'm talking about here), and given that it might be possible to use the other plugin for inspiration, eg. to copy whatever filters he has used. However I acknowledge that my knowledge of this is very basic compared to yours - I know how to create simple filters and functions for my site but that's about it. ;)

seripap pushed a commit to seripap/wordpress-seo that referenced this issue Nov 19, 2015
@pdewouters
Copy link

I think it would be a good idea too. I recently came across the need for it

@Rarst Rarst removed their assignment Aug 31, 2016
@Antonimo
Copy link

Antonimo commented Nov 27, 2016

https://gist.github.com/Antonimo/d930a2a60e468b4c8f4bcafc7465e135

@GermanKiwi
Copy link
Author

Thanks @Antonimo! Is this something I can use on my site right now? If so, where should I put your code? Or do I need to want for it to be incorporated into the SEO plugin officially?

@Antonimo
Copy link

Antonimo commented Dec 2, 2016

Just put it in functions.php as usual

@atimmer
Copy link
Contributor

atimmer commented Dec 16, 2016

This doesn't add much SEO benefit. If you really want this you can use the above code to achieve this.

@atimmer atimmer closed this as completed Dec 16, 2016
hansjovis pushed a commit that referenced this issue Nov 21, 2022
hansjovis pushed a commit that referenced this issue Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants