Modifying the WordPress (more…) link

I found the more feature of WordPress to be very useful, however I wanted to change the link that was displayed. The default is "(more...)", and I wanted it to say something more useful, such as "Continued...". After doing some Googling and finding nothing, I dug through all the PHP files included with WordPress. Finally I found the following in template-functions-post.php, located in the /wp-includes/ directory:

function the_content($more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
	$content = get_the_content($more_link_text, $stripteaser, $more_file);
	$content = apply_filters('the_content', $content);
	$content = str_replace(']]>', ']]>', $content);
	echo $content;
}


function get_the_content($more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
	global $id, $post, $more, $single, $withcomments, $page, $pages, $multipage, $numpages;
	global $preview;
	global $pagenow;
	$output = '';
}

So I figured I would just change the two instances of (more...) to what I wanted to see, save, and upload the file. Well that didn't work. So I continued looking. Finally I found inside the directory for my theme, inside the index.php file, the following:

	<div class="storycontent">
		<?php the_content(__('(more...)')); ?>
	</div>

Ah ha! After changing that, and uploading the file, the (more...) link changed to "Continued...".

One plugin I downloaded to enhance the more feature of WordPress, is the less plugin by Bennett McElwee. By default, WordPress only shows the text after the more link, not the entire post. This plugin changes that by forcing the more link to point to the full URI of the post. Very useful plugin!

Write a Comment

Comment