How to display post excerpts on index page on wordpress
-
Hi Guys,
I’m using DigiNews theme (https://www.ads-software.com/extend/themes/diginews) for my blog (https://healthluv.com). My problem is this theme display full blog post on home page which cause slow page loading.
So I want to display to excerpts instead of full blog post on index page. But not sure how to do it.
I’ve read other solutions as well, which suggests to replace “< ?php the_content(); ?>” with “< ?php the_excerpt(); ?>” in index.php file, but I’m not seeing “< ?php the_content(); ?>” in index file.
Following is the coding in “index.php” file of my theme. Please let me know what changes should I make to see my desired result.
<?php get_header(); ?>
<div id=”content” class=”clearfix”>
<div id=”main” class=”col620 clearfix” role=”main”>
<?php if ( have_posts() ) : ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?><?php
/* Include the Post-Format-specific template for the content.
* If you want to overload this in a child theme then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( ‘content’, get_post_format() );
?><?php endwhile; ?>
<?php if (function_exists(“diginews_pagination”)) {
diginews_pagination();
} elseif (function_exists(“diginews_content_nav”)) {
diginews_content_nav( ‘nav-below’ );
}?><?php else : ?>
<article id=”post-0″ class=”post no-results not-found”>
<header class=”entry-header”>
<h1 class=”entry-title”><?php _e( ‘Nothing Found’, ‘diginews’ ); ?></h1>
</header><!– .entry-header –><div class=”entry-content”>
<p><?php _e( ‘It seems we can’t find what you’re looking for. Perhaps searching can help.’, ‘diginews’ ); ?></p>
<?php get_search_form(); ?>
</div><!– .entry-content –>
</article><!– #post-0 –><?php endif; ?>
</div> <!– end #main –>
<?php get_sidebar(); ?>
</div> <!– end #content –>
<?php get_footer(); ?>
- The topic ‘How to display post excerpts on index page on wordpress’ is closed to new replies.