• Hi,

    I created a code that would show excerpts for all posts except the most recent (top) post and insert featured image thumbnails for the excerpts only.

    However, it puts a thumbnail in the first post, something I don’t want. I only want it for excerpts posts on the first page. How do I fix that?

    The site is here.
    Code – http://pastebin.com/xWPWY5UA

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter FirstProgramming

    (@firstprogramming)

    <?php if ( is_search() | is_home() ) : // Edit this to show excerpts in other areas of the theme?>
        <div class="entry-summary">
        <!-- This adds the post thumbnail/featured image -->
            <div class="excerpt-thumb"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
        <?php the_post_thumbnail('excerpt-thumbnail', 'class=alignleft'); ?></a></div>
                          <?php  if($wp_query->current_post == 0 && !is_paged()) { the_content(); } else { the_excerpt(); }     ?>                     
    
                </div><!-- .entry-summary -->
                <?php else : ?>
                <div class="entry-content">
                        <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
                        <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
                </div><!-- .entry-content -->
                <?php endif; ?>
    Thread Starter FirstProgramming

    (@firstprogramming)

    That is the code that I used to create it. I want it to exclude applying the featured images to ‘the_content()’, not the the_excerpt().

    why are you not applying the same conditional to the thumbnail as you have used on ‘the_excerpt/the_content’ ?

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

The topic ‘Twenty Eleven (Modified) – Excerpt/Preview Image except First Post Issue’ is closed to new replies.