Quantcast
Channel: help – WordPress.org Forums
Viewing all articles
Browse latest Browse all 13924

andrew-s3 on "How to Set Feed to Newest First & Specific Category"

$
0
0

I'm attempting to modify the current code to display The most recent post, followed by the next 4 recent posts from a specific category - in this case, category 4.

here's my code:

<ul class="recent-posts">
<!-- LOOP START -->
<?php $the_query = new WP_Query( 'showposts=5' ); ?>
    <?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
    <!-- THIS DISPLAYS THE POST THUMBNAIL, The array allows the image to has a custom size but is always kept proportional -->

<li><?php the_post_thumbnail( array(100,100) );?></li>
      <!-- THIS DISPLAYS THE POST TITLE AS A LINK TO THE MAIN POST -->

<li><h3><a>"><?php the_title(); ?></a></h3></li>
      <!-- THIS DISPLAYS THE DATE/AUTHOR META DATA -->

<li><span class="featured-data">Posted by <?php the_author_posts_link(); ?> in <?php the_category(', '); ?> | <?php the_time('F d, Y'); ?></span></li>
      <!-- THIS DISPLAYS THE EXCERPT OF THE POST -->

<li><?php the_excerpt(); ?></li>
      <!-- READ MORE LINK -->

<li><a>" class="read-more">Read More...</a></li>
      <hr />
    <?php endwhile;?>
<!-- LOOP FINISH -->

Thanks for your help in advance.


Viewing all articles
Browse latest Browse all 13924

Trending Articles