Site logo

Archived topic

Remove the space before the [...] before Read More link

3 replies · Started by Paul on January 13, 2017

Viewing posts 1–4 of 4

Hi There,

I'm trying to find the function to remove the space before the Read More Link.

It's the auto-generated Read More link.

Could you please help.

Thanks so much.

Are you talking about the single space between the excerpt content and the "..."?

Yes thats correct

Try this php below:

add_action( 'after_setup_theme','tu_remove_read_more' );
function tu_remove_read_more() {
    remove_filter( 'excerpt_more', 'generate_blog_excerpt_more', 99 );
}

add_filter( 'excerpt_more', 'tu_blog_excerpt_more', 99 );
function tu_blog_excerpt_more( $more ) {
    if ( ! function_exists( 'generate_blog_get_defaults' ) )
        return;

    $generate_settings = wp_parse_args( 
        get_option( 'generate_blog_settings', array() ), 
        generate_blog_get_defaults() 
    );
	
    // If empty, return
    if ( '' == $generate_settings['read_more'] )
        return;
		
    return '... <a title="' . esc_attr( get_the_title() ) . '" class="read-more" href="'. esc_url( get_permalink( get_the_ID() ) ) . '">' . $generate_settings['read_more'] . '</a>';
}

Adding php: https://docs.generatepress.com/article/adding-php/

Let me know.

This archived topic is closed to new replies.