Created
March 2, 2021 04:07
-
-
Save ejcabquina/6608addd50d25ada0c61211e9b98087d to your computer and use it in GitHub Desktop.
generate_content_more_link_output
This file contains 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(){ | |
$custom_text = get_field('read_more_text'); | |
return sprintf( ' ... <a title="%1$s" class="read-more" href="%2$s" aria-label="%4$s">%3$s</a>', | |
the_title_attribute( 'echo=0' ), | |
esc_url( get_permalink( get_the_ID() ) ), | |
$custom_text, | |
sprintf(/* translators: Aria-label describing the read more button */ | |
_x( 'More on %s', 'more on post title', 'generatepress' ), | |
the_title_attribute( 'echo=0' )) | |
); | |
}); | |
add_filter('generate_content_more_link_output', function(){ | |
$custom_text = get_field('read_more_text'); | |
return sprintf( | |
'<p class="read-more-container"><a title="%1$s" class="read-more content-read-more" href="%2$s" aria-label="%4$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() ) ), | |
$custom_text, | |
sprintf( | |
/* translators: Aria-label describing the read more button */ | |
_x( 'More on %s', 'more on post title', 'generatepress' ), | |
the_title_attribute( 'echo=0' ) | |
) | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment