Last active
November 5, 2018 23:29
-
-
Save generatepress/a5f0dfd0db3c1d7fc5b217e07203fc58 to your computer and use it in GitHub Desktop.
Remove screen reader text from more link in the feed
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
add_filter( 'generate_excerpt_more_output', function( $more ) { | |
if ( is_feed() ) { | |
return sprintf( ' ... <a title="%1$s" class="read-more" href="%2$s">%3$s</a>', | |
the_title_attribute( 'echo=0' ), | |
esc_url( get_permalink( get_the_ID() ) ), | |
__( 'Read more', 'generatepress' ) | |
); | |
} | |
return $more; | |
} ); | |
add_filter( 'the_content_more_link', function( $more ) { | |
if ( is_feed() ) { | |
return sprintf( '<p class="read-more-container"><a title="%1$s" class="read-more content-read-more" href="%2$s">%3$s</a></p>', | |
the_title_attribute( 'echo=0' ), | |
esc_url( get_permalink( get_the_ID() ) . apply_filters( 'generate_more_jump','#more-' . get_the_ID() ) ), | |
__( 'Read more', 'generatepress' ) | |
); | |
} | |
return $more; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment