Divi is an excellent theme from Elegant Themes with a powerful visual editor built in. One of the many useful Divi modules which you can drop into your page is the Blog module, which displays a grid of recent posts, limited by category. However, if there are no posts in that particular category, the theme displays an ugly message: “No Results Found. The page you requested could not be found. Try refining your search, or use the navigation above to locate the post.”
The simplest way to remove this message, is to override /wp-content/themes/Divi/includes/no-results.php by copying the file into your child theme at /wp-content/themes/your-divi-child-theme/includes/no-results.php. Edit this file and add a wrapper div to the error message:
<div class="entry"> <!--If no results are found--> <div class="no-results"> <h1><?php esc_html_e('No Results Found','Divi'); ?></h1> <p><?php esc_html_e('The page you requested could not be found. Try refining your search, or use the navigation above to locate the post.','Divi'); ?></p> </div> </div> <!--End if no results are found-->
Now you can hide the message using CSS in your style.css by adding the following line:
/* Hide "no results" message on blog module */ .et_pb_blog_grid .no-results { display: none; }
Make sure to include the et_pb_blog_grid class so that the message is only hidden on the blog module because the no-results.php template is also used on the general 404 page, and this message should be displayed.
Hi! This post couldn’t be written anny better!
Reading through this post reminds me of my previous room mate!
He always kept chatting about this. I will forward this article to him.
Fairly certain he will have a good read. Thank you forr sharing!
My homepage :: View (Myanimelist.Net)
I had to change it to
/* Hide “no results” message on blog module */
.et_pb_ajax_pagination_container .no-results {
display: none;
}
to make it work
Divi version 4.19.3
Thx for this. I needed this and your solution worked. However things have changed a bit in 2020. No need for the .et_pb_grid class in the css. Do you know how I might keep the article listed instead of it being blank?
It looks like the class name changed… with the recents updates of Divi.
This should do the job in CSS
.yourblogmodule .not-found-title {
display: none;
}
.yourblogmodule .entry p {
display: none!important;
}
Someone has a better way to do it?
How do you hide a blog section or blog module if you want it to be hidden when there’s no new post (in a particular category) to display?
Hello,
I display an article in a section with Divi.
This article could be expired, then moved to Drafts sometimes. So I experiencing a No Results splash into my section.
I tried your solution, change the no-resulpts.php file by adding the div and class.
I add an ID to my section and put this into my css :
#nemanquezpas .no-results {
display: none !important;
}
But it didn’t work. Could you help me ?
Hi. Can you send me a URL to look at?
Yes but in private, because the website is behind htaccess
is that possible ?
Hello,
have you the possibility to help me ?
Can I give you the access privately ?
Thanks
Sure, contact me via the contact page.
i think that i missunderstood the titel of this post 🙁
I am looking for a way to show the search within the blog modul like on the elegant themes page.
Do you know how this could work?
After much thrashing around, I found the real solution to this. Somewhere on your page, in the Divi Builder view, you will find a module, probably empty. In my case, it is a Fullwidth Post Slider that is unused. Somewhere along the line in editing, saving, etc., either I, or some WordPress gremlin, unchecked the boxes in the Advanced Settings for that module that says
Disable on:
-Phone
-Tablet
-Desktop
Check all those boxes, save, publish, it quits looking for things that aren’t there, and everybody’s happy.
Hope this helps.
Thanks for this Tom. However, wouldn’t it be more sensible to remove the unused module?
Yes it would. Except for the part where it broke the page all to heqq when I removed it. Not a Divi expert, but I can be as stubborn as anybody you know. I’m sure if I had been more persistent, I would have won, but some battles aren’t worth winning. I left it there. Empty.
Haha! Yes, some battles are just not worth fighting… 🙂
Following Tom’s advice above, I looked at my module builder side and found that it had created two “blog” modules. The first one “delivered no results.” Deleted it and no message! Thanks!
Hello – I have received this message on my blog module. However, it is only when I am not logged in as admin. When I am logged in I see all the posts. Is there something I can do to fix this?
Thanks, Ash
Hi Robin,
I stumbled across the same issue with “no results found” on the homepage.
My intention is to build a landing page for my client with divi, without any blog functionalities behind it.
How do I create a page that acts as the homepage? Currently any page I create receives an subdomain URL ( ex http://mydomain.com/home) and when opening mydomain.com I still get the “no results found” page.
Thanks for any advice.
Alex
Hi Alex. It sounds like you need to set your page to be the home page in Divi > Theme Customiser > Static Front Page.
Hi Robin,
Yep, that did the trick; thanks a lot! 😀
All the best from Bukarest, Romania!
Alex
I took over a Divi blog and ended up with this message.
Frustrated me at first until i realized I had deleted a category that was being displayed by the blog module. So it was trying to display content from an ‘XYZ’ category that didn’t exist – hence the message. Or maybe it was just that category had 0 items in it.
I jsut edited the blog module to remove that category and message went away.
Yes, the ugly error message is displayed if the category has no items in it. If you remove the category from the blog module, no posts will ever be displayed so you might as well remove the blog module 🙂
Thanks so much for this information! Is it possible you could walk me through this as I am new to coding and do not know where this info is located? Thank you!
Hi Elisabeth
If you are making customisations to Divi, you should be using a child theme. A child theme allows you to modify the theme template files but keeps these modifications in a separate folder from the Divi theme files. This means that when you update Divi, your modifications are not overwritten, but instead inherit the updated base theme. You can find out how and why here.
When you have created and enabled your child theme, you want to override /wp-content/themes/Divi/includes/no-results.php by copying this file into your child theme at /wp-content/themes/your-divi-child-theme/includes/no-results.php.
Now go to Appearance > Editor and edit includes/no-results.php. Look for the following code:
and add a wrapper class as follows:
Save your changes, and open style.css. Add the following CSS to hide the error message:
Save your changes. The error message should now be hidden.