Title: query_posts function not working in 2011 theme
Last modified: August 20, 2016

---

# query_posts function not working in 2011 theme

 *  [wplearner](https://wordpress.org/support/users/wordpresslearner/)
 * (@wordpresslearner)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/query_posts-function-not-working-in-2011-theme/)
 * hey, wondering if I’m doing something wrong. I’m trying to alter the default 
   query of index.php in the 2011 theme with query_posts:
 *     ```
       get_header(); ?>
   
       		<div id="primary">
       			<div id="content" role="main">
   
       			<?php if ( have_posts() ) : ?>
           <?php 
   
       query_posts( 'posts_per_page=1');//just to get a visible result.
   
       ?>
       				<?php twentyeleven_content_nav( 'nav-above' ); ?>
   
       				<?php /* Start the Loop */ ?>
       				<?php while ( have_posts() ) : the_post(); ?>
       ```
   
 * but for some reason it still keeps showing the default, 20 or whatever it is 
   posts.. Any idea why this could be? (tried with the query posts above the start
   of the conditional as well, but same.)

The topic ‘query_posts function not working in 2011 theme’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [wplearner](https://wordpress.org/support/users/wordpresslearner/)
 * Last activity: [13 years, 10 months ago](https://wordpress.org/support/topic/query_posts-function-not-working-in-2011-theme/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
