• Resolved theankush

    (@theankush)


    Hello everyone, I am using wordpress for 3 years now, and started contributing. I have designed a wordpress theme for my website https://freshjob.in from the scratch. Understanding various concepts of wordpress framework, is not enough, while developing your own theme. In category.php, to display latest posts from that specific category, i used following code:

    <?php query_posts('post_type=post&post_status=publish&posts_per_page=10&paged='. get_query_var('paged')); ?>
    
    	<?php if( have_posts() ): ?>
    
            <?php while( have_posts() ): the_post(); ?>
    
    	    <div id="cat-<?php get_the_ID(); ?>" <?php post_class(); ?>>
    
            	<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( array(50,50) ); ?></a>
    
                    <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    
                    <span class="meta"> <strong><?php the_time('F jS, Y'); ?></strong> </span>
    
    		<?php the_excerpt(__('Continue reading ?','example')); ?>
    
            <?php endwhile; ?>
    
    		<div class="navigation">
    			<span class="newer"><?php previous_posts_link(__('? Newer','example')) ?></span> <span class="older"><?php next_posts_link(__('Older ?','example')) ?></span>
    		</div><!-- /.navigation -->
    
    	<?php else: ?>
    
    		    <p><?php _e('None found.','example'); ?></p>
    
    	   <!-- /#post-404 -->
    
    	<?php endif; wp_reset_query(); ?>
    
    	<!-- /#content -->

    But it is displaying, my entire blog posts from the website. I just want to display posts from that specific category, on whose taxonomy, the visitor is. Kindly have a look at the code above, and help me.
    You can check the link below to have a look on what I am facing. “https://freshjob.in/jobs/extra-interview-tips-and-tricks/&#8221;

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Category page displaying Entire Blog's latest posts’ is closed to new replies.