I have several posts on my wordpress site.
Most of them belong to a specific category, but some don’t.
For all the posts that belong to a category I want to have the following permalink structure:
/%category%/%postname%/
All the other default posts belong “automatically” to the uncategorized category.
Their URL structure will look like this /uncategorized/%postname%/
I want to change permalinks to the following: /%postname%/
Is there a way to make an exception for the permalinks that belong to the uncategorized category?
Thanks in advance!
The solution bellow worked for me.
In function.php, just add :