4
votes

I am new at WordPress and I would like to create a url structure for a recipe site.

/category ( eg: /recipe will list all recipes ).

/category/subcategory ( eg: recipe/chicken list of chicken recipes )

/category/subcategory/postname ( eg: recipe/chicken/Chicken-Breasts-with-Tomatoes

The problem:

When I access /category/subcategory ( /recipe/chicken ) i got 404 not found, but if i access /subcategory ( eg: /chicken ) it works.

I had marked the category "recipe" as the parent of chicken.

Tks a lot, enog

3
I'm assuming you created this via taxonomy and it's not the built in posts? It may be useful to post that code, otherwise try re-saving your permalink structure in the admin panel. - Howdy_McGee
Try resaving the permalink settings so that you'll flush the permalink cache. Also make sure your permalink settings are indeed correct to identify subcategories beneath categories. - Evan Volgas
my permalinks: /%category%/%postname%/ . How can i configure wordpress to identify subcategories beneath categories? - enog

3 Answers

1
votes

You can change your permalinks, adding some extension at the end:

/%category%/%postname%.html

I don't like this solution much, but it makes subcategory pages work.

0
votes

The only thing that work for me was /%category%/%subcategory%/%postname%/ but it a little bit messy with the new posts that you create.

0
votes

I solved it by putting 'en' (short for English) as base for category. This kept the beauty of URL as well as do the job for me that I wanted. It also impacted SEO as search engine thinks of 'en' as 'English'.