Use Custom Read More Text for Teaser Link

This document is deprecated! The information on this page refers to a Thesis version that is now obsolete. Please visit the Thesis Docs for current documentation.

Custom Read More Text

Custom Read More Text

Thesis offers you an easy way to customize the “Read More” text (this is the text which appears when you’ve used the WordPress “more” quicktag in your post) — but what if you’d like to also use this custom text for the teaser’s “Read the full article” link? Read on to find out how to do this!

First, place the following code in your custom_functions.php:

function teaser_read_more() {
  global $post;
  $custom_more = get_post_meta($post->ID, 'thesis_readmore', true);
  if ($custom_more) { ?>
   <p class="read_more"><a class="read_link" rel="nofollow" href="<?php the_permalink() ?>"><?php echo $custom_more; ?></a></p>
  <?php }
  else { ?>
   <p class="read_more"><a class="read_link" rel="nofollow" href="<?php the_permalink() ?>"><?php echo thesis_teaser_link_text(); ?></a></p>
  <?php }

} 

add_action('thesis_hook_after_teaser', 'teaser_read_more');

then, place this code in your custom.css file (you may need to make changes to the values here, in order to match the look of your own site):

.custom .format_teaser a.read_link {
    font-size: 1.05em;
    line-height: 1.5em;
    text-decoration: none !important;
}

.custom .format_teaser p.read_more {
    margin-top: 1em;
}

Finally, go to Thesis Design Options > Teasers > Teaser Display Options, and make sure the link to full article element has been deselected; click the SAVE button to preserve your changes, and then view your site (refresh if necessary) — you’ll see the new teaser link, which is now using your custom “Read More” Text:

Custom Read More Text Used for Teaser Link

Custom Read More Text Used for Teaser Link

Note that, if you’ve not entered any custom “Read More” Text for a particular post, you’ll see the normal default text for your teaser links; if you’d like to change this default text, go to Design Options > Teasers > Link to Full Article and edit the text in the link display text field.