Subscribe On YouTube

Join other subscribers and enjoy other Divi video tutorials!

How To Replace The “No Results Found” Message In The Divi Theme Builder With A Divi Layout

Nelson Miller Profile Orange
This trick will show you how to display a Divi layout in place of the no results found message when there are no posts to show.
no results found message in Divi

▶️ Please watch the video above to get all the exciting details! 👆

1. Create Your Layout In Divi

Save a Section To the Divi Library

We’ll start with the easy part of creating our “no-results” message by building the layout with the Divi Builder. You can choose to do this on any page that you have handy or directly in the Divi Library. Just be sure to use a blue section.

What To Include

You will want to be careful what you say here. In my example, I knew it was going to be a category of dogs that were either available or adapted. If the puppies were all adopted, there would be none to show on the “Adopted” category page. But if the puppies were all Available, and someone sent to the “Available” category, they would also see this same message. So I had to keep it generic, but yet relevant. I included a headline, explainer text, and two buttons.

No results message in divi

2. Use A Divi Child Theme

The only way we can create a no results message with a Divi layout is by using a child theme.

If you do not have a child theme installed yet then I suggest downloading and using our free Divi child theme.

If you already have a child theme installed then you can proceed.

Once you have a child theme installed, go to the place where you prefer to edit the child theme files, whether that be in cpanel, ftp, or in the File Manager plugin (you can’t do this first step from Appearance>Theme Editor because you need to add a folder first).

NOTE: Be sure to follow along with the video as this tutorial is rather technical!

Create a folder called “includes” in the same directory as your functions.php.

Inside that folder, create a new file called “no-results.php.” Open it in a code editor and paste the following snippet below into the no-results.php file of the child theme.

<?php echo do_shortcode('[et_pb_section global_module="1234"][/et_pb_section]'); ?>

3. Get The Divi Layout ID

The last step is to link the Divi Layout you created to the code that you just pasted into your child theme. You may notice the “1234” in the code snippet above. You need to edit those numbers to match the idea of the Divi section saved in your Divi Library.

It’s easy to find the section ID. Just go into edit mode, and you will see a series of letters and numbers in the URL. Again, it may be helpful to follow along with the video.

Edit no results message with Divi Layout

Go ahead and replace the “1234” with those numbers in the no-results.php file. Once you save the file, you are all finished and you can go test this out. The easiest way to test it is to go to your Posts>Categories and click to view one of the categories that does not have any posts in it yet, or just make a quick sample category to test it.

Do It With Our Divi Search Helper!

Make life easier and use the Divi Search Helper instead! This innovative plugin upgrades the existing Divi Search module with all the missing features provided by our addon with new design settings, advanced search criteria options, and improved search result pages.

Divi Search Helper Plugin By Pee Aye Creative

Subscribe For More Things Like This!

At the start of each month, we send out a recap newsletter from the month before with family news, Divi news, our latest tutorials, and product news. Occasionally, if the news is too exciting to wait, we will send out another email separate from the monthly newsletter. That’s what you get when you subscribe, and of course you can unsubscribe if you are no longer interested!

Blog Post Optin
Divi Logo (2)

Shop Our Divi Products

Plugins • Courses • Templates

Visit The Shop

Featured Products

Asset 4

New! Trail Guides

Follow a series of blog posts carefully arranged around a specific topic or goal! Keep track of your progress by marking posts completed, just like a free course!

View Trial Guides

Divi Trail Committee Membership badge with map design

Join The Trail Committee!

Show support for our ongoing work creating community resources at Pee-Aye Creative and enjoy exclusive member perks in return.

Learn More

Divi Tutorials On YouTube

Our videos have views! Join subscribers and enjoy over video tutorials!

Visit Our Channel

Leave A Response!

By commenting you agree to our Blog & YouTube Comments Policy

27 Comments

Comments By Members

These comments are highlighted because they were posted by fans who have a membership on this site.

  1. Abby <span class="comment-author-role-label"><a href="https://www.peeayecreative.com/product/divi-adventure-club/" class="comment-author-role-link" rel="external nofollow" target="_blank">Divi Adventure Club Member</a></span>

    Apologies for sending this twice, I didn’t see a confirmation that it was received.

    This works great, the only issue I’m having is that it doesn’t display on desktop. It will display on mobile and tablet. I’m using WooCommerce and I’ve ensured the visibility settings are correct.

    Here’s a one-time link to access my dev site – https://1ty.me/Tww4yAR

    Thank you for any help you could provide!

    Reply
    • Hemant Gaba

      Hi Abby!

      I have checked the above link and it seems the site is not accessible now. Can you please provide a new link? Apologies for the delay!

      Reply
  2. Jim Colman <span class="comment-author-role-label"><a href="https://www.peeayecreative.com/product/divi-adventure-club/" class="comment-author-role-link" rel="external nofollow" target="_blank">Divi Adventure Club Member</a></span>

    Great help! Just one problem. My text block and background show up but none of the padding or text styling is applied. I can’t figure out what’s blocking it.

    Reply
    • Hemant Gaba

      Hi Jim
      Could you share the URL of your site so I can investigate it further?

      Reply
    • Jim <span class="comment-author-role-label"><a href="https://www.peeayecreative.com/product/divi-adventure-club/" class="comment-author-role-link" rel="external nofollow" target="_blank">Divi Adventure Club Member</a></span>

      SOLVED: The issue was a plugin conflict. Thanks for your great teaching videos. This one works like a charm!

      Reply
      • Hemant Gaba

        Great that your issue is solved.
        You’re welcome! 🙂

Comments By Others

  1. dany

    I am having an issue on the Divi site where the tag archive template not showing posts and returns no results found. I tried everything like using “post for the current page” etc and changing conditions for tag templates but nothing worked. Can you help me what could be the reason of this issue

    Reply
  2. David Thatcher

    Do you mean “adopted” instead of “adapted” regarding the puppies in the example.
    Good luck and thanks for your videos and help pages, sometimes they help me.

    Reply
  3. Andy

    Hi Nelson. This is so helpful. I have a question for you though. I followed all of the steps however I’m having the following issue:
    I have created a search results template in my divi theme builder and what is happening at the moment when I do a serch that yields no results is that the search results template still encompases my no results layout that I created with your method. Specifically the no results layout isn’t covering the whole page but is centralised and surrounded by my search results template.
    Is there a way to exclude the no results layout from the search results template?
    Thanks in advance

    Reply
  4. Katelyn

    The code seems to be pulling in my 404 page template from my theme builder, any ideas on how to work around this? I am hoping to target the portfolio module specifically. Thanks!

    Reply
    • Hemant Gaba

      Hey Katelyn,

      Could you please share the URL of the page for me to investigate it further?

      Reply
  5. Molly

    Thanks for sharing, as always! I’ve followed this tutorial and for some reason the “no results” message isn’t showing anything at all. It’s hidden the default message, but not displaying my custom section. Any ideas why?

    Reply
    • Hemant Gaba

      Hey Molly,

      Could you please remove the code because of which the No result message got disappeared and comment again so I can check from where the issue is arising?

      Reply
      • Molly

        Just removed!

        Some additional insight if this helps:
        – When I went into my blog category template in the Divi builder I could see the custom “No results” message displaying but it was showing below the blog section when no results were available.
        – As a test, I added a ton of padding to the bottom of the section which contains the blog component and when I did that, the custom “no results” message DID display.
        – It just appears that the “no results” message I created based on the tutorial above didn’t replace the default message, it hid the old one and displayed below where the default message would have displayed.

        Not sure if that makes sense. Let me know if you come across anything that might be causing this. Always grateful for your help, thanks!

  6. ahssan moshref

    Hi, Nelson, there is a problem with this method. I am using a search tool as well. And when I type a search word that results in “No Result” it brings up this custom section. In fact, any Blog will bring up the same message if left with no item in the category.

    Is there a way to customize this only to a specific Blog?

    Reply
    • Hemant Gaba

      Hey Ahssan,

      We will check this issue and will let you know what’s the ideal solution for this.

      Reply
  7. Leslee Langlands

    Really great tutorial. Worked perfectly. Thank you!

    Reply
  8. Elisabeth

    Hi Nelson, thanks a lot! I followed your instructions to customize the message in a Divi shop module where only a specific category is shown. Works perfectly! 🙂

    Encouraged by this I added a second line in the file to customize the product category ‘No results’ message:

    Unfortunately, that doesn’t change anything. Why do you think that is?

    Thanks again!

    But

    Reply
    • Elisabeth

      I got it to work, I didn’t need an extra line/2nd library layout, I needed to adjust the page assignments in the theme builder!

      Reply
  9. Chris

    Could this be used to target only specific modules defind by CSS Class?
    For example the shop module when no product turns up on a search?

    Reply
  10. Karen

    Hi could I somehow do this with snippets plugin instead of child theme? Trying to do this for divi with woocommerce shop when it shows no featured items i get the same message.

    Reply
    • Hemant Gaba

      The option of using a child theme is always the best option to opt for but if you want to use any third-party plugin then please try searching it on the internet and you will get a lot of them. 🙂

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Recent Posts

0

Your Cart