Add read more link in excerpt

By default wordpress adds [..] after every excerpt.I have created a function to remove this sign add your own text.

You just need to add this in your functions.php file

add_filter(‘wp_trim_excerpt’, custom_excerpt);
function custom_excerpt($text) {
$text = str_replace(‘[…]’, ‘<a href=”‘ . get_permalink() .'”>..Read More</a>’, $text);
return $text;


About Kapil Chugh

In love with PHP and tweaking WordPress. Hungry for Open Source and new technologies. Honest. God-fearing. Happiest when solving problems.
This entry was posted in WordPress and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s