Site logo

[Resolved] remove dots on article in archive page

Home Forums Support [Resolved] remove dots on article in archive page

Home Forums Support remove dots on article in archive page

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2467241
    Andre

    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

    #2467283
    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.

    #2467441
    Ying
    Staff
    Customer Support

    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/

    #2468073
    Andre

    Perfect !
    Thanks 🙂

    #2468567
    Ying
    Staff
    Customer Support

    No Problem, glad to help 🙂

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.