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.

I guess this has been mentioned before, but after 2 days of browsing i haven't find a complete solution. Maybe someone has come across this problem before?

I'm building a designer portfolio where posts are assigned to more than one categories. Permalinks are set in the form of:

portfolio.com/category-name/post-name/

Example:

  • Post 1
  • Assigned to Category A and Category B

When you visit the Category A page, Post 1 is shown there. When you visit the Category B page, Post 1 is shown there too.

The problem:

When you click Post 1 in the Category A page. It takes you normally to the Post 1 page staying in Category A that is the lower ID category, so permalink is:

portfolio.com/category-a/post-1/

and next previous post links work inside Category A ok.

When you click Post 1 in the Category B page, it takes you normally to the Post 1 page but not staying in Category B, the permalink is still at Category A

portfolio.com/category-a/post-1/

and next previous post links work inside Category A again.

How can i resolve this so when you are in a category page and you click a post that is assigned to multiple categories, the post page will stay in the category from which it was clicked, the permalink will show that category name and the previous and next post links will work inside that category and not the default lower ID category that WordPress is using by default?

I'm really looking forward for a nice solution! Strange that WordPress awesomeness has no option by default on this, since it supports multiple categories.

Thanks!

share|improve this question
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.