Wordpress Technology

Wordpress Tips, Tutorials, Hacks

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!


Both comments and pings are currently closed.

© 2009 | Made by Vancouver Web Design | Internet Marketing