Modifying category template to include additional categories along with the deafult

I’m fairly new to developing on WordPress so please bear with me.

Basically by default WordPress quite nicely lists out posts associated with a category. To avoid creating multiple template files I would like to amend category.php so that it includes the default category + one other category.

Lets say I have the category ‘financial information’ – this lists out all the posts nicely by default, I limit that to 4 posts.

However I also have a category called ‘sponsored’. I want to create another query which gets the posts in ‘financial information’ and ALSO ‘sponsored then limit this to 4 posts.

So the end result is I have the original posts being pulled via the loop but then I also have the sponsored posts coming in that ALSO have the category ‘sponsored’.

I can’t use WP_Query as this requires the category_name, due to wanting my category.php to handle ALL categories I can’t specify this.

Could someone just let me know if what I’m trying to do is possible? I don’t expect anyone to provide the code 🙂 thank you.

Read more here: Modifying category template to include additional categories along with the deafult

Leave a Reply

Your email address will not be published. Required fields are marked *