1

Let me explain my problem. I have this post that uses multiple categories... and categories are being shown as breadcrumbs

I there a way where I can display 1 specific tree?

example I have

game > basketball > teams > team A > players > player1

and

announcement > new players > player1

Now, when I browse game going deep to player1 I will have that first example as my breadcrumb for that page. But, navigating through announcement going deep to player1 will also give that kind of breadcrumb. Is there a way to achieve getting the second breadcrumb?

even using /%category%/%postname%/ as permalink, the url will only use one specific...

like game/basketball/teams/team A/players/player1/

well it's like this,

1st: announcement/

clicking new players: announcement/new players/

after clicking player1: game/basketball/teams/team A/players/player1/


why can't I continue as announcement/new players/player1/ ?

and announcement > new players > player1 ?

1

2 Answers 2

1

To answer your question, it doesn't matter from where you're going to player1. HTTP being a stateless protocol, doesn't care if you're going from announcements or teams or even if by typing directly to the address bar. So what you're asking is not possible without some kind of coding

Now when we have the same content at 2 different urls, wordpress favors just one of those urls & that is a very good thing if you ask me, else search engines will penalize your site for duplicate content.

I recommend leaving it as it is, but if you just want to do it no matter what, you'll need to store the previous pages information somewhere(typically a cookie or session variables). Then you'll need to use this information together with your breadcrumbs generating code in your theme to favor one of the trees.

2
  • actually, it would be just for visual purposes on the site... the permalink is still just /%postname%/. With that said, I really just wanted the breadcrumbs part... Commented Dec 12, 2012 at 11:07
  • Update your question with the code that generates the breadcrumbs. As pointed in the answer, the only way to do what you like is by modifying that code Commented Dec 12, 2012 at 12:52
1

I think it can be done by making get_permalink() to generate links based on context in which they are displayed. If wordpress redirects you to the canonical URL from that post, there probably a plugin which stops it like http://wordpress.org/extend/plugins/disable-canonical-url-redirects.

Now breadcrumb don't realy tell you how you got to that page, but rather how you might have got there. If there are several possible paths then you should simply show all of them (most of the time people will get to the post from google so there is no real breadcrums in any case).

2
  • actually, it would be just for visual purposes on the site... the permalink is still just /%postname%/. With that said, I really just wanted the breadcrumbs part... Commented Dec 12, 2012 at 11:09
  • So you want one format instead of the possible other? Commented Dec 12, 2012 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.