Custom ‘Read More’ text per Post for Twenty Ten

A sophisticated way to get a custom written ‘read more’ text added to your posts in the theme Twenty Ten (or its child themes).

The code builds on this article I posted earlier.

It uses the custom field with the key ‘cont_read’ to hold the custom text.

Add this code to functions.php of the theme:

/* Twenty Ten custom 'continue reading'
/
/ custom field ($key = 'cont_read' ) dependant 'continue reading' text
/ alchymyth 2010
*/
class Transformation_Text_Wrangler {
function reading_more($translation, $text, $domain) {

global $post;
 $cont_read = get_post_meta( $post->ID, 'cont_read', true );
 if( $cont_read ) :
 $cont_read = htmlentities($cont_read, ENT_QUOTES);
 $translations = &get_translations_for_domain( $domain );
 if ( $text == 'Continue reading <span>&rarr;</span>' ) {
 return $translations->translate( $cont_read . ' <span>&raquo;</span>' );
 }
 return $translation; // custom field value
 else :
 return $translation; // standard text
 endif;
 }
}
add_filter('gettext', array('Transformation_Text_Wrangler', 'reading_more'), 10, 4);

4 Replies to “Custom ‘Read More’ text per Post for Twenty Ten”

    1. Thank you for your comment and your intentions.
      All help given in the wordpress support forum is given freely. Therefore, I do recommend only to click the adverts if you are genuinely interested in the services they offer.

      cheers

  1. Thanks for that.Problem is..I don’t have a clue what it all means.All I want to do is be able to view any of the other jpeg header picsin the themes/twentyten file and be able to change the present header pic.I’m not good at technical stuff so I need simple instructions in a step by step way please..i.e.Step 1,Step 2 etc.

Leave a Reply

Your email address will not be published. Required fields are marked *