Categories
CMS Mastering Development Wordpress

Use Custom Post Type archive page for the taxonomies term archive page

In my wordpress theme I created a new custom post type ‘books’ with 2 taxonomies (‘series’, ‘genres’). when I visit the archive of the cpt ‘books’ (site.com/books), I list all the books.

I added a custom frontend filter to get in this archive page books by taxonomy terms by passing an argument to the url with the name of the taxonomy and the terme (like this: site.com/books/?genres=action). Like a book browser.

But wordpress is by default creating the link for my taxonomies like this (site.com/genres/action/) and i want it to be "redirected" to the books post type with the taxonomy argument (site.com/books/?genres=action).

Is it possible to achieve that ? Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *