1

As the title says, I want to remove the taxonomy slug from URL. Instead, I want to keep the post type slug. For example: I have a post type called "Books" (rewrite_slug = books) and a taxonomy called "Genre" (rewrite_slug = genre) which includes "Science fiction", "Drama", "Comedy" etc.

Right now I have two options which work:

site.com/books/genre/comedy/

and

site.com/genre/comedy/

I want the url to look like:

site.com/books/comedy/

Is there a simple rewriting rule for this?

4
  • Is comedy a book or a genre? How will WordPress distinguish between the two?
    – Milo
    Sep 15, 2015 at 17:02
  • @Milo - comedy is a term which belongs to the taxonomy genre. If I want to access a specific book I'd want this url: site.com/books/comedy/some-comedy-book-name.
    – user80414
    Sep 15, 2015 at 17:06
  • @Milo - is it possible to remove the taxonomy slug from the title of the page? That is, instead of SITENAME | Genre Comedy to have SITENAME | Comedy or SITENAME | Comedy Books. Thank you.
    – user80414
    Sep 17, 2015 at 17:57
  • Depending on how your theme handles those titles, you can add a filter to wp_title to set it to whatever you want.
    – Milo
    Sep 17, 2015 at 17:59

0