Daily Tip: Replace Default WordPress Excerpt Ellipsis With Read More Link

April 18, 2010  | 
1 Comment

Add this to your functions.php file. It will replace the default [...] at the end of your excerpt with a “Read More →” link.

function replace_excerpt($content) {
       return str_replace('[...]',
               '<a href="'. get_permalink() .'">Read More →</a>',
               $content
       );
}
add_filter('the_excerpt', 'replace_excerpt');

Want to Submit a Daily Tip to WPMU.org?

If you’ve got a great tip for WordPress, WPMU, or BuddyPress users, send it our way on Twitter: @wpmuorg and we’ll happily credit you. Create a tweetable title and let us know if you have more info or an article you’d like to link it to.

Featured Plugin - WordPress + Google Maps = Perfect

Simply insert google maps into posts, sidebars and pages - show directions, streetview, provide image overlays and do it all from a simple button and comprehensive widget.
Find out more

Featured Plugin - Open an Online Store with MarketPress

Out of all the WordPress ecommerce plugins available, this has got to be the winner - easy to configure, powerful functionality, multiple gateways and more. A simply brilliant plugin!
Find out more

Featured Plugin - Start your own Quora / StackOverflow / Yahoo Q&A site

It's now incredibly easy to start your own Q&A site using nothing more than WordPress - The Q&A plugin simply and brilliantly transforms any site, or page, into a perfect support or Q&A environment.
Find out more

Featured Plugin - Every great SEO tweak you need, in one snazzy bundle

Fully integrated with the SEOMoz API, complete with automatic links, sitemaps and SEO optimization of your WordPress setup - this is the only plugin you need to help you rank your site number 1 on Google - nothing else compares.
Find out more

Featured Plugin - Send beautiful html email newsletters, from WordPress!

Now there's no need to pay for a third party service to sign up, manage and send beautiful email newsletters to your subscriber base - this plugin has got the lot.
Find out more

Featured Plugin - Turn any WordPress page into a fully featured wiki!

To get a wiki up and running you used to need to install Mediawiki and toil away for days configuring it... not any more! This plugin gives you *all* the functionality you want from a wiki, in WordPress!!!
Find out more

Featured Plugin - Add bottom corner (or anywhere else) chat to your site

No javascript required, no third part chat engine, just fully featured chat right in your own database on your own WP sites - couldn't be easier.
Find out more

Featured Plugin - Host sites, get paid, just like WordPress.com

If you've ever wondered how you could offer a paid site management and hosting service, then this is the plugin for you. Offer a freemium or paid service, for any niche you like, it's powered Edublogs.org to success already!
Find out more

Featured Plugin - Easily integrate your WordPress site with Facebook

Would you like to add Facebook comments, registration, 'Like' buttons and autoposting to your WP site? Well, The Ultimate Facebook plugin has got that all covered!
Find out more

One Response to Daily Tip: Replace Default WordPress Excerpt Ellipsis With Read More Link

  1. I tried to make this change on my website but found a different way to do so.
    The file you need to edit is wp-includes/formatting.php. Scroll to the bottom of the file and add the following:

    <?php function gpp_excerpt($text) { return str_replace('[...]', 'Read More →‘, $text); } add_filter(‘the_excerpt’, ‘gpp_excerpt’); ?>

    This is what I used on my website at http://www.nigerianpost.com and it works just the way I want it.
    If you’re using the regular wordpress (not wpmu), the file you need to add this to is functions.php in your theme folder. Add the same code to the bottom of the file and you’ll be good to go.

Click on a tab to select how you'd like to leave your comment

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting