32 | Changing the ‘Read more’ in Twenty Ten Child Theme

g+

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.

This entry was posted in Tips & Tricks, WordPress and tagged , , , , , , , , . Bookmark the permalink.

20 Responses to Changing the ‘Read more’ in Twenty Ten Child Theme

  1. Lonna comments:

    Since most mustangs may be pushed exhausting and maintain properly over time most dealerships have no problems offering good extended coverage.
    Set the timeframe to 1 year. If you wish to use it like a vacation residence as soon as or twice in a yr then you would
    at all times get it for rent for a couple of months
    which you determine to spend right here in town. 2013 was a memorable yr for traders.
    Good factor about black kitchen cabinets is that you are capable of
    finding them in a diverse form of settings. Conversely, Black cabinets
    within the event you utilize it with care it may add class and elegance
    to your kitchen. With the Muslim outfit, there is an opportunity of being the belle of
    the event as a result of with the attractive look
    you would have with the Islamic dress you could have chosen. This Muslim Community
    Website offers a great alternative to the youngsters to seek out their desired soul mate.

    The granite countertop with black highlights offers you continuity.
    Granite countertop performs brilliantly in an even bigger
    house. You additionally possess a selection of utilizing a granite countertop with black highlights.

    Feel free to surf to my homepage :: virtual keyboard
    german (Delores)

  2. Jessika comments:

    The iPad presents a portable solution with the best software for accessing your Pc from anyplace.
    Other than the spectacular 49 key contact sensitive keyboard, the PCR500 presents most of the standard perform you are probably
    to search out on most USB keyboards such as Pitch bend and the all the time helpful
    Modulation lever. You should purchase the whole lot from compact, portable
    midi keyboard an boxen (Chastity) keyboards to full-dimension 88-observe models with
    weighted hammer-motion keys, and a few include extra options equivalent to knobs, pads, buttons and faders that provide you with much more control over
    your software. These are just some of the issues related to beverages and only some of the the reason why specialists encourage individuals to
    drink more water. The histories of every carriage built
    through the time of Nigel Gresley and Edward Thompson by the LNER are included, authentic numbering and re-numbering,
    the place built, when and to what specification. This investment technique takes time however it
    is fairly straightforward. One in all the principle stock
    market investment methods is named basic analysis. 14 million. Don’t forget by
    the best way, that most hedge fund managers use
    6 to 1 leverage, which suggests this investment is sucking
    wind as they are saying.

  3. Damian comments:

    Can you guys send me some 61-Key Midi virtual keyboard russian (Danae) controllers?
    I’m trying to find a good one on Amazon and I can’t seem to find
    ones that are actually USB-Midi compatible or aren’t
    “kids first piano” toys

  4. Polly comments:

    It’s awesome for me to have a web site, which is valuable in support
    of my knowledge. thanks admin

    my weblog 007카지노 (Hollie)

  5. Sagive SEI comments:

    Very Cool man! worked like a chare 🙂 thanks a lot

  6. Darlene L Janssen comments:

    I am a total newbie and I am trying to have a read more on a page, have done masses of reading but not finding anything. Found code in the codex page but do not know which file to put it in. I am using the twenty ten template and tried, index.php, page.php and others to no avail.

    When I used the read more on the page, it seems to ignore the tag and displays the whole page. Could anyone help me figure this out as this is my very first try and I have spent days and got nowhere.

    This is the code I found but I don’t know wher to put it //

    //

    I really have no idea how to make a child theme so was trying to put it in the theme? Any help would be appreciated.

    • alchymyth replies:

      try to check loop.php and loop-page.php in Twenty Ten. what kind of page are you talking about? a static page. or a archive page? ‘read-more’ and static pages don’t really work together.
      to ask all your wordpress related questions, consider joining the wordpress.org support forum – there are many members who should be able to help you with your problems.

  7. Tom Durkin comments:

    I’ve tried a lot of other solutions with no luck but this works swell!

    thanks a lot!

  8. Peter comments:

    Thanks for this – I spent a day and tried a dozen ideas from Google before I found one that actually works!
    Many thanks!

  9. Enrico comments:

    Hi, how we can styling this function? For example, button background for “Get to know more”, etc etc, or just a different font, etc.

  10. Scott comments:

    Does this also change the “…” before the text of the read more? I’m using this in my child theme as I couldn’t find a way to remove the 3 periods before the text.
    // remove the ... from excerpt and change the text
    function change_excerpt_more()
    {
    function new_excerpt_more($more)
    {
    return '<span class="read-more"><a href="' . get_permalink($post->ID) . '">Read the Rest &raquo;</a></span>';
    }
    add_filter('excerpt_more', 'new_excerpt_more');
    }
    add_action('after_setup_theme', 'change_excerpt_more');

  11. Chris comments:

    What about if you wanted to have the post title displayed as the link – as in Continue Reading (post title)

  12. Greg Astles comments:

    Thanks, this is great! Question, though.
    I seem to be breaking this with the text I want to place in there. I’d like to add “But wait, there’s more”, but the apostrophe seems to be breaking it. Is there a way have it in there?

  13. smoo comments:

    Thank you so much for this!
    I have been trying for many hours now to make this happen, and compared with everything else I’ve modified in WP, this has been the hardest solution to track down…
    You are a star :o)

  14. Pingback: Twenty Ten: Free Wordpress Theme (and Related Articles) | READMORE.CE.MS

    g+

    03/11/2010 | […] Transformation Power Tools: Changing the ‘Read more’ in Twenty Ten Child Theme […]

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.