• I want to use the plugin WP Smart Sort to sort my posts alphabetically, except I need the most recent posted first on the home page. The relevant existing code for the home page is below. Is there something I can add to it to force it to include the recent posts and go by date rather than by the alphabetical order I want everywhere else?

    <div id="homebox">
    
            <?php if ($aOptions['homebox-id'] != '') { query_posts('showposts=5&cat=' . $aOptions['homebox-id']); } ?>
            <?php if(have_posts()) : the_post() ?>
    
        	<div id="boxmain">
            	<a href="<?php the_permalink() ?>" title="<?php the_title() ?>"><img src="<?php $key="thumbnail"; echo get_post_meta($post->ID, $key, true); ?>" alt="<?php the_title() ?>" /></a>
                <h3><a href="<?php the_permalink() ?>" title="<?php the_title() ?>"><?php the_title() ?></a></h3>
    
    <?php $key="affiliation"; echo get_post_meta($post->ID, $key, true); ?><p>
    
    			<?php the_excerpt(); ?>
            </div>
    
            <?php endif; ?>
            <?php while(have_posts()) : the_post() ?> 
    
            <div class="boxitem">
            	<a href="<?php the_permalink() ?>" title="<?php the_title() ?>"><img src="<?php $key="thumbnail"; echo get_post_meta($post->ID, $key, true); ?>" alt="<?php the_title() ?>" /></a>
                <h3><a href="<?php the_permalink() ?>" title="<?php the_title() ?>"><?php the_title() ?></a></h3>
    
    <?php $key="affiliation"; echo get_post_meta($post->ID, $key, true); ?>
    
            </div>
    
            <?php endwhile; ?>
    
        </div>
  • The topic ‘Force most recent posts first’ is closed to new replies.