Reputation:
For some reason when you create a subcategory in WP, the permalink to that page does not include it's parent in the url.
For example if you have a category structure like this animals < lizards, the only way you can see the lizards category page is by visiting www.example.com/lizards/. www.example.com/animals/lizards returns 404 but a post assigned to the lizards category still has the permalink as this www.example.com/animals/lizards/beardeddragon, assuming the permalink structure is set to /%category%/%postname%/
This seems to be a common problem as I've browsed the internet to find an answer but none worked for me.
Any ideas how I can fix this?
Upvotes: 1
Views: 2469
Reputation: 6573
/%category%/%postname%/
That will start showing both in the URL structure.
Upvotes: 2
Reputation:
I fixed it by following the first add_action solution here: https://wordpress.stackexchange.com/questions/58471/including-category-base-in-a-post-permalink-results-in-404
And then setting the custom structure to /%category%/%category%/%postname%/.
Upvotes: 0