Support » Plugins and Hacks » Hacks » How do i Re-Insert the loop through query?

  • I am using this code to call post from a certain taxonomy term in the loop. But it excluded all the other post in the loop and it only shows the post from the taxonomy terms.

    What do i add to the code for it show the regular post and the post from the taxonomy terms.

    <?php // Create empty array to store post ids in
             $excludes = array();
    
                             $args=array(
                             'post_type' => array ('gallery','videos'),
    			 'taxonomy'=>'series',
    			 'term' => 'pretty-little-liars',
                             'post_status' => 'publish',
                            );
                            query_posts( $args );
    
     if (have_posts()) : while(have_posts()) : the_post(); ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    Call wp_reset_query() after the loop.

    @bcworkx that didn’t work

    Moderator bcworkz

    (@bcworkz)

    Sorry, I see now I misunderstood what you were asking. However, you still need to use wp_reset_query() afterwards anytime you use query_posts().

    I got enough from your question to know I misunderstood, but I’m not sure I understand completely. Best I can tell, you want to display that particular taxonomy posts first, then all normal posts after that?

    You would need two loops for that, the one you have, then the usual loop for regular posts, with wp_reset_query() in between.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How do i Re-Insert the loop through query?’ is closed to new replies.