• Installed this beautiful theme today. Only thing missing so far is a read more link when using excerpts. It was only 1 line of code to switch archive and category from full posts to excerpts. Replacing the line
    get_template_part( 'template-parts/content', get_post_format() );
    with
    get_template_part( 'template-parts/content','excerpt');
    It works.
    Clicking on the title takes you to the post, but having a “… read more” link underneath the excerpt would be nice. I found a function nisarg_new_excerpt_more() in the functions.php file, but I do not know how to use it or where to add it.

Viewing 1 replies (of 1 total)
  • Thread Starter johanm

    (@johanm)

    Figured something out, it kinda works. In functions.php I changed the function nisarg_new_excerpt_more() to (hardcoded Dutch texts):

    function nisarg_new_excerpt_more( $more ) {
     	return '<p class="read-more"><a href="'. esc_url(get_permalink( get_the_ID() )) . '">' . 'lees verder &raquo;' . '<span class="screen-reader-text"> '. 'lees verder' .'</span></a></p>';
    }

    And in content-excerpt.php, I added nisarg_new_excerpt_more() after the the_excerpt() function call:

    <?php the_excerpt();
    echo nisarg_new_excerpt_more();
    ?>

    Not pretty, but I haven’t done much coding lately. But it works, I now have read more links after excerpts. Also changed the CSS, so it is smaller and right aligned.

    • This reply was modified 8 years, 3 months ago by johanm.
Viewing 1 replies (of 1 total)
  • The topic ‘Read more link for excerpts’ is closed to new replies.