Archived topic
remove dots on article in archive page
4 replies · Started by Andre on December 19, 2022
Hi,
How To Change or Remove The Dots […] At The End Of Excerpts :
https://charlesclement.ch/catalogue/category/catalogue-raisonne/
I tried this in functions.php of the Generatepress child theme, but it doesn't work
function new_excerpt_more( $more ) {
return '' ;
}
add_filter('excerpt_more', 'new_excerpt_more');
Thanks for your help,
Best regards, andre
In the meantime, I used another method by filling in the excerpt from the article.
But if a solution exists, I'm interested :)
I would say that it would be interesting to add its choice in the Generatepress theme customization under layout -> blog -> Archives.
For [...] or ..., or nothing.
Hi Andre,
Can you try this PHP solution?
remove_filter( 'generate_excerpt_more_output', 'generate_blog_read_more_button' );
add_filter( 'generate_excerpt_more_output', 'generate_blog_read_more_button_without_dots' );
function generate_blog_read_more_button_without_dots() {
$settings = wp_parse_args(
get_option( 'generate_blog_settings', array() ),
generate_blog_get_defaults()
);
if ( ! $settings['read_more_button'] ) {
return $output;
}
return sprintf(
'<p class="read-more-container"><a title="%1$s" class="read-more button" 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() ) ),
wp_kses_post( $settings['read_more'] ),
sprintf(
/* translators: Aria-label describing the read more button */
_x( 'More on %s', 'more on post title', 'gp-premium' ),
the_title_attribute( 'echo=0' )
),
);
}
Adding PHP: https://docs.generatepress.com/article/adding-php/
Perfect !
Thanks :)
No Problem, glad to help :)
