I’m trying to accomplish something which I think has to do with multiple loops.
I have a website and I want to have a news section on the homepage. So that would be the latest posts.
Then, I have multiple pages on which I want to have posts from certain categories. For example, I have a ‘study’ page, a ‘sports’ page, and a ‘work’ page. I’d like to have posts about studying on the study page, about sports on the sports page and of course posts about work on the work page.
My guess is to have a normal loop on the homepage, and have loops that only display posts from specific categories on the other pages. It wouldn’t matter that much if new posts from one of the pages would also be displayed on the home page.
However, I have no idea how to do this. I’ve tried things, like specifying from which categories I want to get posts but nothing seems to work.
Could anyone direct me in the right direction on how to accomplish this? I’d say it’s got to do with multiple loops, and I’ve read things about resetting the loop but I can’t get my head around it. Help would be much appreciated :)
Hmm.. could be an option, but I have a menu that is dynamically made by WordPress and I don’t know if (or how) it can include categories as menu items.
Anyway, I figured it would be easier to create templates for each page… each template with a loop that only get posts from a certain category, and then create pages in the WordPress backend and assign the right template to it. If there’s a better way to do this, I’d like to hear also.
If not, my original question remains.. so how would those loops look like?