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;
}

Advertisements

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.

One Response to Add read more link in excerpt

  1. apkgrati.com says:

    What’s up, always i used to check blog posts here early in the break
    of day, as i enjoy to gain knowledge of more and more.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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