Get posts from specific category in dated order
-
Hi all,
I am doing a custom wordpress design that has 3 columns on the front page. Yeah, 3 columns I know…why did I pitch this design again?
Anyway, I need to get the 6 latest posts from a specific category and display them on the page in a 3 column 2 row layout. I need the posts which appear in the 3rd column to get a special class which clears their right margin.
Any ideas on how to best do this? I was thinking the easiest way for me would be to forget about the loop and just get the 6 latest posts from that category individually, but is there a way to do this? For example get the latest post, then get the one after that, then the one after that, but individually, not in a loop. That way I can put them inside of divs which have custom classes.
I suspect there must be some PHP magic that will do this. I’ll keep searching in the mean time.
The topic ‘Get posts from specific category in dated order’ is closed to new replies.