Add Excerpts To WordPress Themes

There are 2 WordPress themes that I like to use, Twenty Ten and Twenty Thirteen for WP 3.6. The Excerpts is only applied to search by default. If we want excerpts to all main page, categories, and archives, we have to add some conditions in “content.php” for Twenty Thirteen and “loop.php” for Twenty Ten.

Twenty Ten Theme “loop.php”

Loop 2010 modification

<?php if ( is_archive() || is_search()||is_home()||is_author()||is_tag() ) : // Only display excerpts for archives and search. ?> <div class=”entry-summary”>

<?php the_excerpt(); ?>
</div><!– .entry-summary –>

Twenty Thirteen Theme “content.php”

content.php 2013 mods

<?php if ( is_search()||is_author()||is_tag()||is_archive()||is_home() ) : // Only display Excerpts for Search ?> <div class=”entry-summary”>
<?php the_excerpt(); ?>

</div><!– .entry-summary –>

Leave a Reply

Your email address will not be published. Required fields are marked *