• Hello – my theme has a “Latest News” category template that displays the latest posts from every category (see code below.) Is there a way to make it display just ONE particular category? Thanks!

    <?php
    
    	/* Template Name: Latest News */
    
    ?>
    
    <?php get_header(); ?>
    
    <div id="main">
    
    	<div id="post-area">
    
    		<h1>Latest News</h1>
    
    		<ul class="archive">
    
    			<?php
    
    									$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    
    									$args= array(
    
    										'posts_per_page' => 14,
    
    										'paged' => $paged
    
    									);
    
    									query_posts($args);
    
    			?>
    
    			<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    			<li>
    
    				<?php if (  (function_exists('has_post_thumbnail')) && (has_post_thumbnail())  ) { ?>
    
    				<div class="archive-image">
    
    					<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_post_thumbnail('small-thumb'); ?></a>
    
    				</div><!--archive-image-->
    
    				<div class="archive-text">
    
    					<a href="<?php the_permalink() ?>" class="main-headline"><?php the_title(); ?></a>
    
    					<p><?php echo excerpt(38); ?></p>
    
    					<div class="headlines-info">
    
    						<ul class="headlines-info">
    
    							<li>Posted <?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . ' ago'; ?></li>
    
    							<li class="comments-icon"><a href="<?php comments_link(); ?>"><?php comments_number( '0', '1', '%' ); ?></a></li>
    
    						</ul>
    
    					</div><!--headlines-info-->
    
    				</div><!--archive-text-->
    
    				<?php } else { ?>
    
    				<div class="archive-text-noimg">
    
    					<a href="<?php the_permalink() ?>" class="main-headline"><?php the_title(); ?></a>
    
    					<p><?php echo excerpt(38); ?></p>
    
    					<div class="headlines-info">
    
    						<ul class="headlines-info">
    
    							<li>Posted <?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . ' ago'; ?></li>
    
    							<li class="comments-icon"><a href="<?php comments_link(); ?>"><?php comments_number( '0', '1', '%' ); ?></a></li>
    
    						</ul>
    
    					</div><!--headlines-info-->
    
    				</div><!--archive-text-noimg-->
    
    				<?php } ?>
    
    			</li>
    
    			<?php endwhile; endif; ?>
    
    		</ul>
    
    		<div class="nav-links">
    
    			<?php posts_nav_link(' — ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?>
    
    		</div><!--nav-links-->
    
    	</div><!--post-area-->
    
    </div><!--main -->
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Page shows all posts – would like it to show just one category’ is closed to new replies.