Possible for Category Base and Custom post Type to share the same slug/permalink?

Rebuilding an author/writer website in WordPress.

I have a custom post type of books. Working OK.

I’d also like my category base to be books. Not working as yet.

So a book URL would be like:

https://www.authorname.com/books/title

And a category URL would be:

https://www.authorname.com/books/fiction

How can I achieve this?

My workaround is a category URL like this (working):

https://www.authorname.com/books/category/fiction

Would prefer to add code in functions.php or .htaccess than use a plugin.

Thanks

Read more here:: Possible for Category Base and Custom post Type to share the same slug/permalink?

Leave a Reply

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