Skip to content

Instantly share code, notes, and snippets.

@JanHoek
Last active April 20, 2017 16:05
Show Gist options
  • Save JanHoek/15c846f77f9e2f910f4c to your computer and use it in GitHub Desktop.
Save JanHoek/15c846f77f9e2f910f4c to your computer and use it in GitHub Desktop.
Accessible “Read More” links for Genesis
<?php //* Don't copy the php
//* Accessible Read More links for Genesis
add_filter('excerpt_more', 'jan_read_more_link');
add_filter( 'the_content_more_link', 'jan_read_more_link' );
function jan_read_more_link() {
$trimtitle = get_the_title();
$shorttitle = wp_trim_words( $trimtitle, $num_words = 5, $more = '…' );
return '<div class="read-more">Continue reading… <a rel="nofollow" href="'. esc_url( get_permalink() ) . '">' . 'Continue Reading: ' . $shorttitle . '</a></div>';
}
@cdils
Copy link

cdils commented Aug 5, 2014

Suggestion: add rel="nofollow" to your read more link.

You've also got an extra a tag in there :)

@JanHoek
Copy link
Author

JanHoek commented Aug 6, 2014

Thanks Carrie, I changed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment