Last active
April 20, 2017 16:05
-
-
Save JanHoek/15c846f77f9e2f910f4c to your computer and use it in GitHub Desktop.
Accessible “Read More” links for Genesis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Suggestion: add
rel="nofollow"
to your read more link.You've also got an extra
a
tag in there :)