Skip to:
Content
Pages
Categories
Search
Top
Bottom

Creating a Loop that only Shows Sticky Posts?


  • Clicknathan
    Participant

    @clicknathan

    Can anyone help me with the following WP_Query? I just want to show a loop that shows only our sticky topics. I’m trying to use this:

    ` $sticky = get_option( ‘sticky_posts’ );
    $args = array(
    ‘posts_per_page’ => 1,
    ‘post__in’ => $sticky,
    ‘ignore_sticky_posts’ => 1,
    ‘post_type’ => ‘topic’
    );
    $stickythreads = new WP_Query($args);
    while ($stickythreads->have_posts()) : $stickythreads->the_post(); ?>

    MY STUFF

    `

    But it isn’t limiting the results to sticky posts?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar