2 loops on 1 page (for posts from 2 different categories)
-
Hello all.
I’m brand new to WP – and to the forums here – so I hope I’m doing everything within the rules. I’ve made some searches but have not been able to find exactly what I’m looking for.
I built a static website some time ago for my local youth orchestra. Now I want to integrate WP into the site so the committee can look after news updates themselves. For now, I just want to let them put ‘News’ posts on the site’s home page (which consists of a left-hand sidebar and a right-hand ‘main content’ area).
I have figured out how to make the page ‘WP aware’ and to display posts from a “News” category in the right-hand ‘main content’ area (all while utilising the site’s own styling). So far so good.
I would now also like to display posts from a “Tidbits” category in the left-hand sidebar.
So, in my WP admin, I would have 2 mutually exclusive categories: “News” for the main content area and “Tidbits” for the left-hand sidebar.
I guess I need to have 2 WP loops which will separate the posts from each of the 2 categories? (The “News” loop would go in the main content area div and the “Tidbits” loop would go in the left-hand sidebar div.)
Could someone suggest a couple of lines of code which could go at the top of each loop so that they would include only the posts from the relevant category?…
I will really appreciate it if you can help but, as I say, I’m totally new to WP so please don’t make things too techy…
Thanks in advance.
- The topic ‘2 loops on 1 page (for posts from 2 different categories)’ is closed to new replies.