How To Replace The No Results Found Message In The Divi Theme Builder With A Divi Layout Tutorial by Pee Aye Creative

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

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.
Categories: Tutorials
no results found message in Divi

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 they puppies were all adapted, there would be none to show on the “Adapted” 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.

26
Last updated Jan 12, 2021 @ 4:10 am

Please share this post!

Nelson Lee Miller (aka The Divi Teacher)

Nelson is the owner of Pee-Aye Creative Co in the beautiful state of Pennsylvania. He loves helping small businesses, exploring, building websites with Divi, and teaching others.
Divi Adventure Club Product And Course Membership by Pee Aye Creative

Become A Member!

Gain access to everything we offer!

Learn More

Leave A Response!

By commenting you agree to our Blog & YouTube Comments Policy

4 Comments

  1. 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
  2. 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

Submit a Comment

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

Asset 7

Shop Our Divi Products

Plugins β€’ Courses β€’ Templates

Visit The Shop

Divi Adventure Club Product And Course Membership by Pee Aye Creative

Become A Member!

Gain access to everything we offer!

Learn More

Divi Tutorials On YouTube

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

Visit Our Channel

Recent Posts

Pin It on Pinterest

0

Your Cart