Forums

Show sticky posts in selected category at the top (2 posts)

  1. alekken
    Member
    Posted 2 years ago #

    I would like to extract the posts that are marked as sticky and show them at the top in each category (archive.php).

    When I use this function:
    query_posts(array('post__in'=>get_option('sticky_posts')));

    I get sticky posts from all categories.

    What can I do to extract sticky posts from only the selected category?

    I need something were the current category name/ID is automatically selected.

    Thanx :)

  2. benz001
    Member
    Posted 2 years ago #

    You need to include the category in the query, using query_posts() as you have above overides the default query.

    This post may be the answer you are looking for
    http://wordpress.org/support/topic/272324?replies=2

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags