Title: A Loop issue
Last modified: August 30, 2016

---

# A Loop issue

 *  [jezebel_](https://wordpress.org/support/users/jezebel_/)
 * (@jezebel_)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/a-loop-issue/)
 * Hey everyone,
 * I’m trying to request posts from a category at the category.php using The Loop.
   For some unknown reason, I am only retrieving one post at the loop. Any suggestions?
   Here’s the code:
 *     ```
       <div id="content" class="clearfix">
   
       		<h1 class="archive-title"><?php single_cat_title( '', true ); ?></h1>
   
       		<?php query_posts('post_type=post') ?>
   
       		<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> 
   
       		<div>
       			<span>oi</span>
       		</div>
   
       		<?php endwhile; 
   
       			  else : ?>
   
       				<p>Não há posts nesta categoria!</p>
       		<?php endif; ?>
   
       		</div><!-- #content -->
       	</div><!-- #primary -->
   
       <?php get_footer(); ?>
       ```
   

Viewing 1 replies (of 1 total)

 *  [newbiesup](https://wordpress.org/support/users/newbiesup/)
 * (@newbiesup)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/a-loop-issue/#post-6594400)
 * Did you check how many posts are categorized under the category?
 * The codes look fine except that `<?php query_posts('post_type=post') ?>` is redundant.

Viewing 1 replies (of 1 total)

The topic ‘A Loop issue’ is closed to new replies.

## Tags

 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [problem](https://wordpress.org/support/topic-tag/problem/)
 * [the-loop](https://wordpress.org/support/topic-tag/the-loop/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [newbiesup](https://wordpress.org/support/users/newbiesup/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/a-loop-issue/#post-6594400)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
