[Support request] Remove the space before the […] before Read More link

Home Forums Support [Support request] Remove the space before the […] before Read More link

Home Forums Support Remove the space before the […] before Read More link

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #263901
    Paul

    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.

    #263902
    Leo
    Staff
    Customer Support

    Are you talking about the single space between the excerpt content and the “…”?

    #263903
    Paul

    Yes thats correct

    #263907
    Leo
    Staff
    Customer Support

    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.

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