[resolved] recent posts excerpt (3 posts)

  1. davidmarino88
    Posted 3 years ago #

    All, I would like to update my wordpress twenty eleven theme to have recent posts as excerpts instead of the current (last post as full and everything else showing only the title). Does anyone have easy code to include in the child theme?
    Thanks in advanced.

  2. Michael
    Forum Moderator
    Posted 3 years ago #

    copy showcase.php into the child theme, add the the_excerpt() to this section:

    // For all other recent posts, just display the title and comment status.
    					while ( $recent->have_posts() ) : $recent->the_post(); ?>
    						<li class="entry-title">
    							<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
    <span class="recent-excerpt">
    <?php the_excerpt(); ?>
    							<span class="comments-link">
    								<?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?>

    will need some formatting using .recent-excerpt

  3. davidmarino88
    Posted 3 years ago #

    Thank you for your help. It worked. The <?php the_excerpt(); ?> was key.

Topic Closed

This topic has been closed to new replies.

About this Topic