[Resolved] Hide the featured image in the archive page

Home Forums Support [Resolved] Hide the featured image in the archive page

Home Forums Support Hide the featured image in the archive page

  • This topic has 3 replies, 2 voices, and was last updated 1 month ago by Elvin.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2053530
    Jan Pecenka

    Hi, how I can hide the featured image of the posts in the archive page for post format image or video?

    #2054049
    Elvin
    Staff
    Customer Support

    Hi there,

    Try this PHP snippet:

    add_filter( 'generate_featured_image_output', function( $output ){
    	if( ( is_archive() || is_home() ) && has_post_format( array( 'video', 'image' ), get_the_ID() ) ){
    		return;
    	}
    	return $output;
    });

    A wise man once said:
    "Have you cleared your cache?"

    #2055212
    Jan Pecenka

    It looks like it works. Thank you

    #2055217
    Elvin
    Staff
    Customer Support

    No problem. 😀

    A wise man once said:
    "Have you cleared your cache?"

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