Excerpt in Latest posts template

AppsPro Tech - Quickly create elegant website with this app WordPress theme.
GK User
Fri Jun 27, 2014 2:41 pm
Please can you tell me how to show only excerpt of posts in Latest posts template but not whole content? Thank you! :)
User avatar
Fresh Boarder

GK User
Sun Jun 29, 2014 7:34 pm
Hello,

Try to replace AppsProTech/content.php file with the following:

Code: Select all
<?php

/**
 *
 * The default template for displaying content
 *
 **/

global $tpl;

?>

   <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
      <header>
         <?php get_template_part( 'layouts/content.post.header' ); ?>
      </header>
      
      <?php get_template_part( 'layouts/content.post.featured' ); ?>
      
      <?php if ( is_search() || is_home() || is_archive() || is_tag() ) : ?>
      <section class="summary">
         <?php the_excerpt(); ?>
         
         <a href="<?php echo get_permalink(get_the_ID()); ?>" class="btn"><?php _e('Read more', GKTPLNAME); ?></a>
      </section>
      <?php else : ?>
      <section class="content">
         <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', GKTPLNAME ) ); ?>
         
         <?php gk_post_fields(); ?>
         <?php gk_post_links(); ?>
      </section>
      <?php endif; ?>
      
      <?php get_template_part( 'layouts/content.post.footer' ); ?>
   </article>


Don't forget about the backup.
User avatar
Moderator

GK User
Mon Jun 30, 2014 12:00 pm
Thank You very much! :-)
User avatar
Fresh Boarder


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.