I’m creating magazine style theme (not e-commerce) and I want to display 3 latest posts from ex. X, Y and Z category, where this 1st post will be with thumb and other 2 only titles. I found some similar solution themes, but when I look into the code, they created 2 loop for each category (2×3=6) and with this 6 loops code looks very messy. So I decided to create function (ex. latest_post_from_category($cat);) to display this post.
Here comes the question is my decision right, if yes do have any advices to make this function more flexible?
Thanks for your time.
a function can become more flexible with params and switches. example follows
Things like that can really make a design come together.
The Thumbs
In regards to this you only really need the post id and wordpress provide the functions so with my example above you can loop and do an if statement