Custom “Read More” Links for Your Posts

Posted on January 29th, 2011

This is a really useful hack if you want to better define or customize the look of your “Read More” links for posts. The first thing you have to do is to edit your posts and create custom fields. Give them custom_more as a key, and whatever text you want to be displayed as the value. Then you have to edit your index.php file (and also your category.php, search.php, etc) and find a line similar to this:
the_content(“Read more”);

Now just replace it with this code:

<?php $custommore = get_post_meta($post->ID, 'custom_more', true); ?>
<?php if (!$custommore) { $custommore = 'Read More &raquo;'; } ?>
<?php the_content($custommore); ?>