categories - Cannon see subcategory in permalink

admin2025-04-17  0

There are a lot of articles (old one, though because I use new WordPress 5.3.1) about how to include category and subcategory in WordPress URLs. I followed those articles (pretty much are the same), but something is wrong.

I checked Settings > Permalinks > Custom Structure and added /%category%/%postname%/, and all I can see is parent category, not child category.

It's the same issue whatever template I use, so I guess template is not a problem.

What is wrong?

There are a lot of articles (old one, though because I use new WordPress 5.3.1) about how to include category and subcategory in WordPress URLs. I followed those articles (pretty much are the same), but something is wrong.

I checked Settings > Permalinks > Custom Structure and added /%category%/%postname%/, and all I can see is parent category, not child category.

It's the same issue whatever template I use, so I guess template is not a problem.

What is wrong?

Share Improve this question asked Dec 17, 2019 at 22:27 vujkevujke 1032 bronze badges 1
  • 1 Please assign only child category so it will display parent and child category in URL. – Bhupen Commented Dec 18, 2019 at 6:58
Add a comment  | 

1 Answer 1

Reset to default 1

Good question.

WordPress determines the permalink by finding the category closest to the root.

  • If the parent category is selected (or if both the parent category and the child category are selected), then the permalink will only include the parent category.
  • If only the child category is selected, then the permalink will include the parent category followed by the child category.

So, for your case, be sure to select only the child category.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1744884753a272470.html

最新回复(0)