I've read dozens of articles on how to create an excerpt but nothing has worked so far. For testing reasons I use the "Twenty Thirteen" theme, although I developed a child template.
In the index.php of Twenty Thirteen, I put the_excerpt()
function in the loop. It looks something like this now:
if ( have_posts() ) :
/* The loop */
while ( have_posts() ) : the_post();
the_excerpt();
endwhile;
twentythirteen_paging_nav();
else :
the_excerpt();
endif;
In the functions.php file I put the following code at the very top:
function new_excerpt_more($more) {
// Use .read-more to style the link
return '...<span class="continue-reading"> <a href="' . get_permalink() . '">'.'Read More »' . '</a></span>';
}
add_filter('excerpt_more', 'new_excerpt_more');
but the complete excerpts are printed out all the time. What am I doing wrong?