This topic has 11 replies, 3 voices, and was last updated 2 years, 8 months ago ago by Olga Barlow
Hi
When you use the WordPress search, sidebar block so on blog page to search posts (not the Xstore theme advanced search in the header) it is showing results of the emails used in email builder. ie New order email / registration email etc.
Can we hide these results as they should never be visible on the front end.
Thanks
Hello,
Please provide URL and screenshots for a better understanding of your request.
Regards
Hi
I can’t show my site until tmw now. But basically when you activate the email builder to use custom emails – go to a blog post. Any that has the sidebar search.
https://xstore.8theme.com/elementor/maecenas-parturient-duis-mus-fames/
Then search for “order” or something in the email like “site_email” etc.
These emails from the builder show in search results. But only the sidebar WordPress one. Not the shop one in the header.
Hello,
Thanks for the reply. I’ve passed this question to our dev team.
Regards
Hiya
See private info for working example of what I mean…..
Any thoughts on how to hide these….? It’s really urgent as we cannot go live with this huge error. Please urgently advise.
Regards hiding testimonials, do you think this would work as a function? And if so can we also edit to hide the email blocks?
===========================
add_action( ‘init’, ‘exclude_testimonials_from_search’, 99 );
function exclude_testimonials_from_search() {
global $wp_post_types;
if ( post_type_exists( ‘wpm-testimonial’ ) ) {
// exclude from search results
$wp_post_types[‘wpm-testimonial’]->exclude_from_search = true;
}
}
===========================
Or This – can hide testimonials etc but not the customizer emails… I have decided to install this instead of the snippet above because I can control all the other static blocks that are showing up –> https://wordpress.org/plugins/mpress-hide-from-search/
Hi
Additionally, is it possible to hide the page featured image in main product search but keep the product images there?
See private info for this query – thanks.
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
Amazing thank you very much – perfect! Glad I done video’s now as it made it easier to explain lol – but thanks; great job – perfect!
One last query regards this – the function you added, can you confirm if the one above it (or similar) will be ok to hide the testimonials on search results page as we don’t want to see those – or, is there a way we can design the actual testimonials page to add a sidebar or something to help it look right?
Please clarify – thanks again, awesome job. Top support.
Sorry – added private data in post above as issues are still there after saving 🙁
Sorry
Hi
Might have been a cache issue as seems ok now – please leave open in case and I will test this over the coming days.
Thanks again for awesome help & support. 🙂
Hello,
You are welcome! Feel free to ask if you need help.
Regards
Tagged: blog, search results, show blocks, sidebar, themes, woocommerce, wordpress
You must be logged in to reply to this topic.Log in/Sign up