• Hi everyone,

    I’m having a problem with the_excerpt() function and I’m wondering if you can help me out.

    What I want to do is display an excerpt at three different locations. I know i can simply show the 3 most recent excerpts in a row but this time I want show just 1 excerpt at each location because they are at different places on the site.

    However in the first location i want to show the most recent excerpt and in the second location I want to display only the second most recent and in the third place only the third most recent excerpt.

    Any Idea’s on how to achieve this?

    Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • I know i can simply show the 3 most recent excerpts in a row

    what code are you using?

    generally, you could add the ‘offset’ parameter:
    http://codex.wordpress.org/Template_Tags/get_posts
    http://codex.wordpress.org/Class_Reference/WP_Query#Offset_Parameter

    Thread Starter g-no

    (@g-no)

    Hi alchymyth,

    Thanks for your reply. I’m currently using this code:

    <?php query_posts("posts_per_page=1"); ?>
    	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    		<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    
    			<h4><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h4>
    
    			<?php include (TEMPLATEPATH . '/inc/meta.php' ); ?>
    
    			<div class="entry">
    				<?php the_excerpt(); ?>
    			</div>
    
    		</div>
    
    	<?php endwhile; ?>
    
    	<?php include (TEMPLATEPATH . '/inc/nav.php' ); ?>
    
    	<?php else : ?>
    
    		<h2>Not Found</h2>
    
    	<?php endif; ?>

    The offset parameter seems to be very handy indeed. I’m not very experienced with developing for wordpress. Would you know how to use the offset parameter for the excerpt in this loop?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘show excerpt by order’ is closed to new replies.