How to show entries related to main category
There are a couple of problems with that code Selecting the wrong terms First of all, you are storing tags instead of categories in the $terms variable. The taxonomy name for categories is category. That line should look like this. $categories = get_the_terms( get_the_ID(), ‘category’); For sake of expresivity, I changed the $terms variable to … Read more