Reply 320738 to: Search results on blog sidebar show blocks

Avatar: Rose Tyler
Rose Tyler
Support staff
March 28, 2022 at 15:28

Hello,

1/ We excluded a few post types as you asked from the default WordPress search (404 page or search from sidebar widget ) by adding the next code in your child-theme/functions.php

add_action( 'init', 'etheme_exclude_post_types_in_search', 99 );
function etheme_exclude_post_types_in_search() {
global $wp_post_types;
if ( post_type_exists( 'viwec_template' ) ) {
$wp_post_types['viwec_template']->exclude_from_search = true;
}
if ( post_type_exists('testimonials') ) {
$wp_post_types['testimonials']->exclude_from_search = true;
}
}



2/ We fixed the issue about page featured image in full width search globally in
et-core-plugin/app/models/customizer/class-ajax-search.php
on 405 line 
’img’ => (isset($this->request[‘full_screen’]) && $post->post_type == ‘page’) ? false : get_the_post_thumbnail_url( $post->ID, ‘medium’ ),
Also this fix will be included in next theme update

Regards

Go To The Whole Conversation In Topic
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.