Title: Increasing latest post count
Last modified: August 19, 2016

---

# Increasing latest post count

 *  [crisp82](https://wordpress.org/support/users/crisp82/)
 * (@crisp82)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/increasing-latest-post-count/)
 * Hi,
 * I have installed TheMorningAfter from WooThemes, and am working on customising
   the main page. I would like to have the main page show the 10 most recent posts,
   with 5 featured posts in the sidebar. As this is one of their free themes, there
   is no support, and the forums are via paid subscription only.
 * I am very new to PHP however and cannot quite get to grips with the code on the
   page.
 * The current code that displays the latest post:
 *     ```
       <?php
       				while (have_posts()) : the_post();
   
       				$do_not_duplicate = $post->ID; ?>
   
       				<div id="latest_post">
       					<h3 class="mast"><?php _e('Latest Posts','woothemes'); ?></h3>
   
       					<div id="latest_post_image">
       					<?php woo_image('width=470&height=210'); ?>
       					</div>
   
       					<h3 class="latest_post_title" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php _e('Permanent Link to','wootheme');?> <?php the_title(); ?>"><?php the_title(); ?></a></h3>
   
       					<p><?php if ( $woo_options['woo_post_content_home'] == "true" ) the_content(); else the_excerpt(); ?></p>
   
       					<div class="latest_post_meta">
       						<span class="latest_read_on"><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php _e('Continue Reading','woothemes'); ?></a></span>
       						<span class="latest_comments"><?php comments_popup_link('Post a comment', 'One comment', '% comments', '', 'Comments off'); ?></span>
       						<?php $cat = get_the_category(); $cat = $cat[0]; ?>
       						<span class="latest_category"><a href="<?php echo get_category_link($cat->cat_ID);?>"><?php echo $cat->cat_name; ?></a></span>
       					</div>
       				</div>
   
       				<?php
       				break;
       				endwhile; ?>
       ```
   
 * Is there anyway to adapt the code to show the 10 most recent posts, whilst still
   retaining the settings applied to the ‘Latest Post’ section in CSS?
 * I have tried:
 * `query_posts($query_string . "&showposts=10");`
 * and
 *     ```
       global $query_string;
       query_posts($query_string . "&showposts=10");
       ```
   
 * and
 *     ```
       $latest_id = get_cat_id($woo_options['woo_latest_category']);
       query_posts("cat={$latest_id}&showposts=10");
       ```
   
 * None of which have been successful. They do not increase the Latest Post count.
 * The following has allowed me to have 10 posts displayed, but I cannot get the
   it to pick up the CSS for the ‘Latest Post’ no matter where I insert it:
 *     ```
       $loop = new WP_Query( array( 'post_type' => 'post', 'posts_per_page' => 10 ) );
       while ( $loop->have_posts() ) : $loop->the_post();
       the_title();
         echo '<div class="entry-content">';
         the_content();
         echo '</div>';
       endwhile;
       ```
   
 * Please help!
 * Thanks,
 * crisp82

The topic ‘Increasing latest post count’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [crisp82](https://wordpress.org/support/users/crisp82/)
 * Last activity: [15 years, 10 months ago](https://wordpress.org/support/topic/increasing-latest-post-count/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
