Uncategorized

How to Customize “Read More” Text in Genesis

By March 25, 2014 No Comments

After the excerpts on your blog, you’ll see a boring little “read more” link. Here’s how you can customize that text, or even change it to an image, so it’s more inviting for people to click.

These instructions are for the Genesis Framework.

Step 1

Go to your Theme Functions aka functions.php.  Make sure you’ve selected your child theme, not the Genesis framework.

Step 2

Add the following code to the bottom of the file:

add_filter( 'excerpt_more', 'child_read_more_link' );
add_filter( 'get_the_content_more_link', 'child_read_more_link' );
add_filter( 'the_content_more_link', 'child_read_more_link' );
function child_read_more_link() {

return '<a href="' . get_permalink() . '" rel="nofollow">EDIT THIS PART</a>';
}

Step 3

Edit the link text to whatever you want to display instead of “read more.” You can even choose a custom image – just insert your HTML code instead of text.

Step 4

If you want to make this link into a button instead, add class=”button” right before the “href.” (As long as you have a button class in your CSS file.)

<a class=button href="' . get_permalink() . '" rel="nofollow">EDIT THIS PART</a>'

Step 5

Now that you’ve customized the link, you can add something before the link if you want. I like to use “[…]” because it works great when you cut off the excerpt mid-sentence. I also like to put the link down on the next line. So here’s an example of what that looks like:

add_filter( 'excerpt_more', 'child_read_more_link' );
add_filter( 'get_the_content_more_link', 'child_read_more_link' );
add_filter( 'the_content_more_link', 'child_read_more_link' );
function child_read_more_link() {

return '[...]

<a class="button" href="' . get_permalink() . '" rel="nofollow">continue reading</a>';
}

 

Leave a Reply