[Twenty eleven] How to add excerpts and thumbnails
-
As a title i want to add excerpts and thumbnails (the feature image i use on the article) to the twenty eleven main page (not only for the search feature).
Before the last 2.0 update i was using this script that work at 100%:
In functions.php add:
// This sets the dimensions for the thumbnails displayed on the homepage add_image_size('excerpt-thumbnail', 140, 140, true);
In content.php find
<?php if ( is_search() ) : // Only display Excerpts for Search ?> <div class="entry-summary"> <?php the_excerpt(); ?>
andreplace with:
<?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 the_excerpt(); ?>
In style.css add to
.entry-summary { padding: 1.625em 0 0;
this line:
ext-align: justify;
Because the content.php changed with the last update i’m not able anymore to replace the code above.
Someone can help me to fix the issue?
thanks.
- The topic ‘[Twenty eleven] How to add excerpts and thumbnails’ is closed to new replies.