If else statement for category
-
I need to create an if else statement (I think) so that when the user is in a category that has sub categories, they will not see posts… However when they are in a subcategory with NO child categories, I would like them to see the posts then.
So far I’ve got it working, however it shows the posts regardless of if there are sub categories.
To show these sub categories I’ve used this code: https://pastebin.com/NEZuwCem
To show the posts, I’ve just used the wordpress loop: https://pastebin.com/m0LSpHjt
I just need some help combining the two into an if else statement (I haven’t got much php experience).
Many thanks in advance!!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘If else statement for category’ is closed to new replies.