Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #147661
    audrajwolfe
    Participant

    Thank you for a beautiful theme! I would like to remove the ellipses that appear after excerpts in the High Responsive theme. I’ve already created a child theme so that I can create custom excerpts for all content, so I’d like the excerpts to just end with a period. I tried some basic Google searches, but none of the suggested code seems to fix the problem. Is there a small tweak to the functions.php?

    The site is audrajwolfe.com. As an example, see the … in the text on the featured slider. I want to remove that.

    Thanks!

    #147675
    Skandha
    Participant

    @audrajwolfe: Go to => Child Theme Folder => functions.php and add the following Code.

    if ( ! function_exists( 'highresponsive_excerpt_more' ) ) :
    	/**
    	 * Replaces "[...]" (appended to automatically generated excerpts) with ... and a option from customizer.
    	 * @return string option from customizer prepended with an ellipsis.
    	 */
    	function highresponsive_excerpt_more( $more ) {
    		if ( is_admin() ) {
    			return $more;
    		}
    
    		$more_tag_text = get_theme_mod( 'highresponsive_excerpt_more_text',  esc_html__( 'Continue reading >', 'high-responsive' ) );
    
    		$link = sprintf( '<a href="%1$s" class="more-link"><span class="more-button">%2$s</span></a>',
    			esc_url( get_permalink( get_the_ID() ) ),
    			/* translators: %s: Name of current post */
    			wp_kses_data( $more_tag_text ) . '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>'
    		);
    
    		return '.' . $link;
    	}
    endif;
    add_filter( 'excerpt_more', 'highresponsive_excerpt_more' );
    
    if ( ! function_exists( 'highresponsive_custom_excerpt' ) ) :
    	/**
    	 * Adds Continue reading link to more tag excerpts.
    	 *
    	 * function tied to the get_the_excerpt filter hook.
    	 *
    	 * @since High Responsive 1.0
    	 */
    	function highresponsive_custom_excerpt( $output ) {
    
    		if ( has_excerpt() && ! is_attachment() ) {
    			$more_tag_text = get_theme_mod( 'highresponsive_excerpt_more_text', esc_html__( 'Continue reading >', 'high-responsive' ) );
    
    			$link = sprintf( '<a href="%1$s" class="more-link"><span class="more-button">%2$s</span></a>',
    				esc_url( get_permalink( get_the_ID() ) ),
    				/* translators: %s: Name of current post */
    				wp_kses_data( $more_tag_text ) . '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>'
    			);
    
    			$output .= '.' . $link;
    		}
    
    		return $output;
    	}
    endif; // highresponsive_custom_excerpt.
    add_filter( 'get_the_excerpt', 'highresponsive_custom_excerpt' );

    Let me know if this works out.
    Kind Regards,
    Skandha

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Remove ellipses from custom excerpts?’ is closed to new replies.