Beautify URL with query string
-
Hello,
I have a custom Archive page for a Custom Post Type (called “Story”) that has its own navigation using categories.
I use two levels of categories and therefore I use two query vars, the original ‘cat’ and a custom query var ‘p_attr’ which is just to keep track of the current ‘parent’ category that ‘cat’ belongs to.
Anyway, the URL’s look like this:
https://mydomain/story/?cat=41&p_attr=3
I am wondering how I can beautify such a URL so that the query vars appear as path elements in the URL with either the category numbers or better yet the category names. So the above could instead be:
https://mydomain/story/{name of ‘p_attr’ category}/{name of ‘cat’ category}
Thanks in advance for any help with this.
- The topic ‘Beautify URL with query string’ is closed to new replies.