• I’m looking for a way to make a “graduated listing” of the posts my main page, so that the reader can quickly access more posts, but not have to download too much content.

    I’d like it to look something like this:

    • The first 5 posts as normal (ie: until the more… bar)
    • The next 10 with title, plus a shorter excerpt
    • The next 10 with titles only

    Anybody know of a plug-in or code sample?

    Is this a job for Customizable Post Listings?
    (https://www.coffee2code.com/archives/2004/08/27/plugin-customizable-post-listings/)

Viewing 6 replies - 1 through 6 (of 6 total)
  • You will, probably, need Multiple Loops for that.

    VisioGuy: You could do it with a single loop, by creating a counter that keeps track of what post is being displayed in the loop.

    Something like this might work for you:

    <?php $post_index = 0; ?>
    
    <?php while (have_posts()) : the_post(); ?>
    
    	<div class="post" id="post-<?php the_ID(); ?>">
    
    		<?php if ($post_index < 6) { ?>
    
    			(show title, date, author, etc..)
    
    			<?php the_content('Read the rest of this entry &raquo;'); ?>
    
    			(show comment link and stuff)
    
    		<?php } else if ($post_index < 11) { ?>
    
    			(show the title)
    
    			<?php get_the_content('Read the rest of this entry &raquo;'); ?>	
    
    		<?php } else { ?>
    
    			(just show the title)
    
    		<?php } ?>
    
    	</div>
    
    <?php $post_index++; ?>
    
    <?php endwhile; ?>

    Although for the shortened excerpt, that would need a small modification. Instead of using the_content, you can use get_the_content (which will return, but not echo the result). You could simply use the substr function to shorten it, but that will remove your ‘more’ link. Of course you could get it first from the string, shorten it, and re-add it back, but it just depends on how complicated you want to make it ??

    Hey Aleister –
    Why not just use the_excerpt instead of the_content then?

    HandySolo: Because that would make too much sense ?? j/k

    Good thinking ??

    Thread Starter visioguy

    (@visioguy)

    Thanks folks! You are all out of control!

    * The first 5 posts as normal (ie: until the more… bar)
    * The next 10 with title, plus a shorter excerpt
    * The next 10 with titles only

    There’s some lingo for that graduated style, I think it’s called a mullet. Anyone know the term?

    Good way to put a lot more post-titles down below without making a super-long page of complete posts.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Graduated Post Listings’ is closed to new replies.