I'm trying to make my blog posts show an excerpt but can't seem to do it manually. My blog site is here.
I've gotten this snippet from the wordpress.org site
<?php the_excerpt(); ?>
and it tells me to replace the
<?php the_content(); ?>
with it. However I can't just replace it my index.php file as then it excerpts everything. (Maybe because of how my index.php file is set up?)
<?php
/**
* The main template file.
*/
get_header(); ?>
<div id="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php endwhile; // end of the loop. ?>
<?php if (function_exists("pagination")) {
pagination($additional_loop->max_num_pages);
} ?>
</div><!-- #main -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
I've tried to replace the have_posts() and then replace the second line of code and then even alter this lines:
and I get my excerpt under my post in my post but then it makes my website REALLY slow.
For some reason my choices for only showing summary in Settings > Review don't apply so I'm having to do it manually.
Any help is appreciated as to how I can customize this excerpt code to work with my blog.
UPDATED
As Linnea suggested I have updated the content-page.php page to this:
<?php
/**
* The template used for displaying separate posts on blog page.
*
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<span class="entry-header">
<h1 class="blog entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
<h2 class="blog entry-subtitle">Posted on: <?php the_time('F j, Y'); ?></h2>
</span><!-- .entry-header -->
<div class="entry-content">
<?php the_excerpt(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'toolbox' ), 'after' => '</div>' ) ); ?>
<?php edit_post_link( __( 'Edit', 'toolbox' ), '<span class="edit-link">', '</span>' ); ?>
</div><!-- .entry-content -->
</article><!-- #post-<?php the_ID(); ?> -->
Where the <?php the_excerpt(); ?>
is now used to be <?php the_content('<br/><br/>CONTINUE READING...'); ?>
however there is no change to my blog entries on my blog. Maybe there is another area I should be looking?
home.php
instead ofindex.php
and if it uses a different template part.