• swollenpickles

    (@swollenpickles)


    I’m trying to create a ‘features’ box on my homepage to show extracts from the two most recent posts from Category A.

    I can get it to display posts but not from the correct category. How can I do this.

    Here’s what I have:

    <?php if (have_posts()) : ?><br />
    		<?php while (have_posts()) : the_post('category_name=Parent Category 1&showposts=3'); ?>
    		<h2 id="post-<?php the_ID(); ?>">
    			<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
    			<?php the_title(); ?></a></h2>
    			<?php the_time('F jS, Y') ?>
    
    			<div class="entry">
    				<?php the_excerpt('Read more...'); ?>
    			</div>
    
    			<p><?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
    
    			<?php endwhile; ?>
    			<?php endif; ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Displaying post extracts from specific category using loop’ is closed to new replies.