I am working on a website where we have blogposts.
These blogposts have 2 custom taxonomies: subject and region.
The permalink of a blogpost looks like this:
/subject/blogpost-title
my normal blogpost archive is /subject which lists all blogposts from a certain subject (custom taxonomy). This is fine.
However my client also would like the following archive
/region/region-name/knowledge
this link should show all blogposts for the region. Via a custom rewrite I can show these blogposts on the archive page:
$new['region/([^/]+)/knowledge/?$'] = 'index.php?post_type=post&_cat_regio=$matches[1]';
This works. But the permalink / breadcrumb of the blogposts is of course still: /subject/blogpost-title
So as soon as you click on subject in the breadcrumb you are out of the region area and back into the normal post archive.
Questions:
Would it be possible to rewrite the url of the post when under region to (so basically have an alternative permalink based on where you are)
/region/region-name/knowledge/blog-title
And 2: would this be a good idea? I know you can set the canonical url on the post so Google won't get confused. And I understand the need to show the latest blogpost for a region. But would there be a better solution?
Has anyone experience with a setup like this?
Any comments are highly appreciated!
get_permalink
which would be returned? You can have mulltiple URLs that go to the same place, but you need one single URL to be the canonical, authorative, defacto URL. If you do not then there are heavy SEO penalties, performance penalties, etc etc as well as semantic bugs and problems that crop up. Also you need a single question, not multiple. This isn't a discussion forum or thread, people need to be able to write an answer/solution, they can't do that if you have a collection of questions, it has to be specific