excerpt codes
Tips And Tricks | WordPress

Add Excerpts To WordPress Themes

August 29, 2013 / 159 views

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 -->

Paid Links

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.