I would like to override the default post archives, via category.
In some cases (not all), I have 2 level-categories, such as:
Parent Category: "Video"
- Subcategory "Comedy"
- Subcategory "Action"
But some other categories, are just single-level.
Currently, no matter which category you choose, you get a list of posts, no matter whether its a main- or sub- category.
What I would like to do, is when entering the category listing, there is a test of sub-categories exist, and if so, the posts should be lists as such:
- post 1
- post 2
- post 3
- post 4
- post 5
- post 6
If however, there are no subcategories, than the default listing is displayed:
- post 7
- post 8
- post 9
How can this be done?
I have very basic PHP knowledge, and have a PHPCode script installed, but I'm not sure how to access the archive/category page.
If its relevant, I am using Avada (child) theme.