WordPress: Nice URL for category (ACF-field) of custom post type

55 Views Asked by At

I defined a custom post type (CPT) called "projects" with an advanced custom field (ACF) to define a category, like "cat 1", "cat 2" for every project. I use an archive-projects.php template to show all projects. To filter the projects I set up a URL-Parameter and manipulate the query dynamically. E.G. "/projects/?cat=cat 1" shows all projects of category "cat 1". This works fine.

However, I would prefer to have nice and hierarchical URLs/links like "/projects/cat-1/".

How can I achieve this? I suppose it has somthing to do with "rewrite rules". Would I have to define it in the .htaccess and how? Or is there an easy WordPress solution to this? Which would be the best way without plugins?

0

There are 0 best solutions below