Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 ?

share|improve this question

2 Answers 2

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.

share|improve this answer
    
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... –  Reigel Dec 12 '12 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 –  Mridul Aggarwal Dec 12 '12 at 12:52

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).

share|improve this answer
    
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... –  Reigel Dec 12 '12 at 11:09
    
So you want one format instead of the possible other? –  Mark Kaplun Dec 12 '12 at 12:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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