• 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)
  • 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.