I'm sorry if this question is explained somewhere, I couldn't find it. But it's also difficult to express this special thing in a second language..
I have a very simple homepage, and on that homepage I would like to display a "Tip". I've tried the Daily Tip plugin, as that does seem to do what I would like, but it's very buggy. So I thought, maybe I can single out a category and use posts to show that tip. The homepage is already with just 2 last posts: One from category Blog and one from category Column. On the right side I would like Tip, but with a special styling, so I have to separate it from the normal while loop.
So this would be the result:
article: BLOGPOST - article: COLUMN - custom: DAILY TIP (highlighted)
(I'm not allowed to post an image)
Does anyone have an idea how to achieve this?
Maybe good to know that the code I've entered for the first two posts is:
$post_ids = array(0); foreach( array( 3, 4) as $cat_id ) { if ( $posts = get_posts(array('cat' => $cat_id, 'showposts' => 1)) ) { $first = array_shift($posts); $post_ids[] = $first->ID; } } query_posts(array('post__in' => $post_ids)); if (have_posts()) : while (have_posts()) : the_post(); >
(and so on)
Thank you so much in advance!
query_posts()
pretty much ever).query_posts
see: The Codex itself also has a warning aboutquery_posts
. You are just asking about generating the markup for the results. Do you have any of that code to post?