Title: query_posts() stopped working
Last modified: August 19, 2016

---

# query_posts() stopped working

 *  Resolved [Jim Parrillo](https://wordpress.org/support/users/jparrillo/)
 * (@jparrillo)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/query_posts-stopped-working/)
 * I’m trying to display a specific second post on a page, and it was working fine
   before, and all of a sudden, it just stopped.
 * I double checked my backup, and they’re identical (I never touched the main page–
   only was fixing CSS issues). WordPress is processing the first post fine, but
   it suddenly stopped performing the query for the second post. I also checked 
   the source code, and there’s no output of text that’s being hidden – so it’s 
   not a CSS issue.
 * Any ideas??
 * Here’s the code for the first and second loops:
 *     ```
       <div id="secondary-upper1">
       	<!-- Start the Loop. -->
       	<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
       	<!-- Display the Title as a link to the Post's permalink. -->
       	<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
       	<!-- Display the Post's Content in a div box. -->
       		<div class="entry">
          		<?php the_content(); ?>
        		</div>
       	<!-- Stop The Loop (but note the "else:" - see next line). -->
       	<?php endwhile; else: ?>
       	<!-- The very first "if" tested to see if there were any Posts to -->
       	<!-- display.  This "else" part tells what do if there weren't any. -->
       	<p>Sorry, no posts matched your criteria.</p>
       	<!-- REALLY stop The Loop. -->
       	<?php endif; ?>
       </div>
   
       <div id="secondary-upper2">
       	<?php query_posts('p=130'); if(have_posts()) : the_post(); ?>
       	<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
       	<?php the_content(); ?>
       	<?php endif; ?>
       </div>
       ```
   

Viewing 1 replies (of 1 total)

 *  Thread Starter [Jim Parrillo](https://wordpress.org/support/users/jparrillo/)
 * (@jparrillo)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/query_posts-stopped-working/#post-1192771)
 * User Error… never mind… :p

Viewing 1 replies (of 1 total)

The topic ‘query_posts() stopped working’ is closed to new replies.

## Tags

 * [query_posts](https://wordpress.org/support/topic-tag/query_posts/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [Jim Parrillo](https://wordpress.org/support/users/jparrillo/)
 * Last activity: [16 years, 7 months ago](https://wordpress.org/support/topic/query_posts-stopped-working/#post-1192771)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
