[Resolved] Remove excerpt from the archive pages

Home Forums Support Remove excerpt from the archive pages

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #898902
    Hasan

    Hi,

    Just purchased the pro version of GeneratePress and going to ask a lots of questions, as I am setting up a new photography site!

    First question is, how to remove the excerpts completely form the archive pages only? I am using the GeneratePress child theme, and have placed the following code on the functions.php taking from a previous forum post suggestion:

    
    /*
    	Remove excerpts from the achrive pages only
    */
    
    add_filter( 'wp_trim_excerpt', 'db_excerpt_metabox_remove' );
    function db_excerpt_metabox_remove( $excerpt ) {
    	$output = $excerpt;
    	
    	if ( is_archive() && has_excerpt() ) {
    		$output = '';
    	}
    	
    	return $output;
    }
    

    But nothing happens. The excerpts are showing as the same.

    I’ve set the excerpt length to 0, which is showing “…” and the “read more” link (“show story” in my case). The excerpts are being generated automatically.

    Please suggest. Thanks for your help!

    Regards,
    Hasan

    #898915
    David
    Staff
    Customer Support

    Hi there,

    you won’t need that filter function, thats solely if you’re using a manual excerpt.

    The ‘…’ are displayed because of the Read More.
    Do you want the read more button showing?

    #899051
    Hasan

    Thanks David!

    I want to remove both the “…” and the read more link.

    Best regards,
    Hasan

    #899056
    David
    Staff
    Customer Support

    Remove the Read more text from the Read More Label in the Customizer so it is empty. This will remove both.

    #899073
    Hasan

    That worked perfectly!

    Thanks David!! 🙂

    #899075
    David
    Staff
    Customer Support
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.