Quantcast
Viewing all articles
Browse latest Browse all 4

Changing the ‘Read more’ in Twenty Ten Child Theme

To change the ‘read more’ text in a child theme of Twenty Ten, one needs to add a few lines to functions.php of the child theme.

This procedure uses a method that I came across in an introductory article about programming a child theme of Twenty Ten, by Aaron Jorbin, who himself was building upon Mangling strings for fun and profit, by WordPress lead Developer Peter Westwood.

class Transformation_Text_Wrangler {
function reading_more($translation, $text, $domain) {
$translations = &get_translations_for_domain( $domain );
if ( $text == 'Continue reading <span class="meta-nav">&rarr;</span>' ) {
return $translations->translate( 'Get to know more <span class="meta-nav">&raquo;</span>' );
}
return $translation;
}
}
add_filter('gettext', array('Transformation_Text_Wrangler', 'reading_more'), 10, 4);

This way of customising texts in a child theme is applicable to all the strings of the mother theme.


Viewing all articles
Browse latest Browse all 4

Trending Articles