• Hello!

    I would like to exclude category from the loop and I have some question:

    <?php if ( is_home() ) {
    			query_posts($query_string . '&cat=-124');
    			}
    		?>
            <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
            	<?php get_template_part( 'content', get_post_format() ); ?>
            <?php endwhile; else: ?>
                <p><?php _e('empty'); ?></p>
            <?php endif; ?>

    A guy told me I have to use global $post, posts instead of $query_string, whats the difference? I read in the codex I have to run wp_reset_query(); after i “finished”? Why? And where have to put that code? (wp_reset_query();)

    Thank you very much!

The topic ‘Question about query_posts’ is closed to new replies.