How to add a read more button in genesis framework child theme?

677 views Asked by At

In My WordPress blog I'm using Genesis framework with Modern Blog child theme. Now I am trying to add read more button on archive page. It is same as WordPress general Function.

I have found a code over internet but this is not work for me.

add_filter('excerpt_more', 'get_read_more_link');
add_filter( 'the_content_more_link', 'get_read_more_link' );
function get_read_more_link() {
   return '...;<a href="' . get_permalink() . '">[Read More]</a>';
}
1

There are 1 answers

0
rctfan1999 On BEST ANSWER

You should add this to your themes child functions.php file:

// 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">[Read More] &hellip;</a>';
}