Use a single wordpress category.php file for every category registered

0

As the title suggests, I’m trying to use one category.php file for every category registered by a user in the back-end. I’ve always created category-[specific category].php files in the past but this feels very messy as the design usually remains the same.

Without being specific in the query I return all posts in all categories however, I want to be able to show the custom posts for only the category selected from the nav. The problem is, I can’t seem to find a way to pass the category the user selected into the query in order to only return posts attributed to it.

Thanks in advance for any help.

Link: Use a single wordpress category.php file for every category registered
Source: Stack WordPress

Share.

About Author

Leave A Reply