WP Fab

Fabricating Fabulous WordPress Websites

  • Home
  • About
  • Projects
  • Contact

Edit the “Read More ” Link on Genesis Theme Blog or Content Archive Pages

by Laura 13 Comments   Dec 19th, 2010

The Read More link on the Blog or Content Archive pages can easily be changed to anything you like.

Suppose you’d like the link to say “Continue Reading…” Simply put this code in your functions.php file:

// Edit the read more link text
add_filter('get_the_content_more_link', 'custom_read_more_link');
add_filter('the_content_more_link', 'custom_read_more_link');
function custom_read_more_link() {
return '&nbsp;<a class="more-link" href="' . get_permalink() . '" rel="nofollow">Continue Reading &hellip;</a>';
}

The code above should be placed in your child theme functions.php file anywhere after:

require_once(TEMPLATEPATH.'/lib/init.php');

and before the following closing code (if it exists):

?>

If you’d like to apply this custom read more to the excerpt as well, add this line at the beginning of the code above:

add_filter( 'excerpt_more', 'custom_read_more_link');

Which gives you a complete block of code that looks like this:

// Edit the read more link text
add_filter( 'excerpt_more', 'custom_read_more_link');
add_filter('get_the_content_more_link', 'custom_read_more_link');
add_filter('the_content_more_link', 'custom_read_more_link');
function custom_read_more_link() {
return '&nbsp;<a class="more-link" href="' . get_permalink() . '" rel="nofollow">Continue Reading &hellip;</a>';
}

Filed Under: How To

Comments

  1. abby @ thingsforboys says

    June 2, 2014 at 3:10 am

    thank you!

    Reply
  2. Alex Jongeneelen says

    June 18, 2014 at 3:54 am

    Thanks!

    The only thing i did in functions.php of the Neo-theme (child theme of Genersis) was replacing the word “Read More” in “Lees verder”. That did the trick! See code below.

    /** Custom “Rread More” link */
    add_filter( ‘excerpt_more’, ‘zp_read_more_link’ );
    add_filter( ‘get_the_content_more_link’, ‘zp_read_more_link’ );
    function zp_read_more_link( ) {
    return ‘… ‘.__( ‘Lees verder ‘,’neo’ ).’»‘;

    Reply
    • Laura says

      September 8, 2014 at 1:54 pm

      Alex,
      You did not add a class to your link, nor a no follow. The class is important if you want to ever style that link. The no follow is important too, but I’ll leave that for you to Google as lots has already been written on the subject.

      Reply
  3. Athlone says

    December 4, 2014 at 12:35 am

    Thank you, appreciate you taking the time to post this.

    Reply
  4. Yannick says

    December 26, 2014 at 12:27 pm

    Sometimes the issue is only because the theme is trying to redefine the language variable “Read more…” (that already exists in WordPress) as “[Read more…]” (including the brackets) and do not include translations to other languages, which makes it confusing.

    If you see that, you can get yourself *inside* the theme files, find the __(‘[Read more…]’, ‘theme_name’)
    and change it for
    ‘[‘.__(‘Read more…’).’]’

    This way, you only translate “Read more…” from the default WordPress config and add the brackets around it. This should be a “best practice” item for themes developers, otherwise they’re just making non-English site builders loose their time on details.

    Reply
  5. Beena says

    January 24, 2015 at 10:22 am

    I’m getting the following error Parse error : syntax error, unexpected ” <a
    class="more-link"
    hr' (T_CONSTANT_ENCAPSED_STRING) in /home/
    menoavgd/public_html/#####.com/wp-content/
    themes/Genesis/functions.php on line 103

    Reply
    • Laura says

      January 14, 2016 at 6:41 pm

      You have a syntax error on line 103 of your functions file.

      Reply
  6. cws says

    February 13, 2015 at 12:47 pm

    Thanks!

    Reply
  7. Ali Sajjad says

    February 26, 2015 at 2:18 am

    How i customize that read more button in css ?

    Reply
    • Laura says

      January 14, 2016 at 6:54 pm

      The read more link has a class on it that you can use to do this.

      Reply
  8. Mike Butcher says

    July 27, 2015 at 12:13 am

    Just wanted to say thanks… integration worked perfectly for the site I was working on…

    Reply
  9. Kelvin Igbinigie says

    August 24, 2015 at 9:36 am

    Thanks Laura..

    I just added the Continue Reading tag to my blog built with Genesis… It worked perfectly. What about styling it?

    Reply
  10. Gaurav Verma says

    May 1, 2017 at 1:07 am

    Thanks, laura, its work like a charm

    Reply

Leave your comment below Cancel reply

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

CAPTCHA
Refresh

*

Let’s Connect!

Follow Us on TwitterFollow Us on LinkedIn

Recent Posts

  • Fix Simple Sidebars “Illegal String Offset” error
  • Don’t be fooled by domain renewal letters
  • I love Lightning Base WordPress hosting
  • Genesis Changes: The Essential Guide for Genesis Framework Developers
  • Clean up weird characters in your WordPress posts
privacy policy ∣  disclosure ∣  terms