• Resolved beatcore

    (@beatcore)


    Hi,

    is it possible with a hook to remove images from the search results page?

    I know i could do it with CSS, but would prefer a cleaner method 🙂

    Thank,
    best regards!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @beatcore,

    Are you referring to the Featured Image of the posts?

    Looking forward to hearing from you.

    Kind regards,
    Herman 😊

    Thread Starter beatcore

    (@beatcore)

    Hi Herman,

    in my case post images added in a post on the right side aswell as product images – in fact all images showing in the search 😛

    thank you,
    regards

    Hi @beatcore, sorry for the delay.

    It’s because the Search Result page is using the Archive template.

    Do you think the snippet on this doc or this one can help you on this matter?

    Kind regards,
    Herman 🙂

    Thread Starter beatcore

    (@beatcore)

    Hi Herman,

    the 2nd one did the trick with a small adjustment:

    function disable_feattured_image_for_posts( $status ) {
    
    	// disable featured image for pages.
    	if ( 'archive' == get_post_type() ) {
    		$status = false;
    	}
    
    	return $status;
    }
    
    add_filter( 'astra_featured_image_enabled', 'disable_feattured_image_for_posts' );

    Thank you!

    YAYY!! 🙌

    Thanks for sharing the code. Might be useful for other users who would like to achieve the same/similar thing.

    Please mark this thread as Resolved and feel free to start a new thread if there is anything else related to Astra we can help you with.

    Kind regards,
    Herman 😊

    Thread Starter beatcore

    (@beatcore)

    Resolved, thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Remove Images on Search Template’ is closed to new replies.