MorningAfter increase 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, and then a featured posts below:
<?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; ?> <div id="home_featured"> <h3 class="home_featured"><?php echo $woo_options['woo_featured_heading']; ?></h3> <?php $feat_id = get_cat_id($woo_options['woo_featured_category']); $limit = $woo_options['woo_featured_limit']; $the_query = new WP_Query("cat=$feat_id&showposts=$limit"); while ($the_query->have_posts()) : $the_query->the_post(); $do_not_duplicate = $post->ID; ?> <div class="feat_content"> <?php woo_image("width=65&height=65"); ?> <div class="feat_title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php _e('Permanent Link to','wootheme');?> <?php the_title(); ?>"><?php the_title(); ?></a></div> <div class="feat_exc"> <?php if ( $woo_options['woo_post_content_home'] == "true" ) the_content(); else the_excerpt(); ?> </div> </div> <?php endwhile; ?> </div>
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 ‘MorningAfter increase latest post count’ is closed to new replies.