Support » Fixing WordPress » Display latest 5 posts from a category with sticky posts at the top

  • I am trying to display 5 posts from a specific category that includes sticky posts and normal posts. I want the sticky posts to display first, and then the rest.

    I have read all the codex in regards to sticky posts and I know that this:
    $posts = array(
    "showposts"=>5,
    "cat"=>1,
    "post__in" => get_option("sticky_posts"),
    "caller_get_posts" => 1
    );

    Will display 5 sticky posts from the category with the ID “1”. If 5 sticky posts are available they will be displayed. If not, it will just display however number of sticky posts have been set and ignore normal posts.

    How can I make it display 5 posts from that category with sticky posts at the top?

  • The topic ‘Display latest 5 posts from a category with sticky posts at the top’ is closed to new replies.