Home / excerpt / Add “Read More” permalink to the end of the_excerpt
  • Add “Read More” permalink to the end of the_excerpt

    add-read-more-permalink-to-the-end-of-the-excerpt

    Adding this snippet to the functions.php of your wordpress theme will add a “read more” permalink at the end of the excerpt much like the_content does.

    wordpress snippet : PHP

    <>
    function excerpt_readmore($more) {
    	return '... <a href="'. get_permalink($post->ID) . '" class="readmore">' . 'Read More' . '</a>';
    }
    add_filter('excerpt_more', 'excerpt_readmore');
    

    ( WordPress codex functions, hooks, in this snippet. )

    excerpt_more, get_permalink, add_filter,
  • Pingback: Append ‘Read More’ to the end of the_excerpt | WerdsWords()

  • http://twitter.com/glebovgin Glebov I

    Didn’t work for me =(

    • http://wpsnipp.com Kevin Chard

      Do you use the “the_excerpt” function within your template?

  • Jhardy1974

    Is there a way to add the post title to the read more section?

  • chiappa

    ah perfect, thank you so much!

  • Neha

    1. At the end of my post , a button named “permalink” is showing but i want to change it to “read more”.
    2. While clicking on this button , my Featured image is not showing up , all i can see is my Post without its Featured image.
    Suggest something….

Build a better with wpsnipp.com

Weekly snippets, themes, deals coupons roundup.

x No Thanks