Replace [...] By Link ‘Read More’ - Blogging for Beginners learn Seo online free step by step

Replace [...] By Link ‘Read More’

Should you need to replace [...] by link ‘Read More’, you would only need to create next function in ‘popular’ functions.php file.

function trim_excerpt($text) {
	global $post;
	$moreLink = ' ... <a href="' . get_permalink($post->ID) . '">Read More &raquo;</a>';
	$text = str_replace('[...]', $moreLink, $text);
  return $text;
}
add_filter('get_the_excerpt', 'trim_excerpt');

If you wish you could substitute text for any another content.

Pretty simple! Enjoy!

Tags: replace [...], wordpress hack, wordpress tip

 

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.