How to Add a Search Field to Diviโ€™s Secondary Menu

Last Updated on September 16, 2022 by 4 Comments

How to Add a Search Field to Diviโ€™s Secondary Menu
Blog / Divi Resources / How to Add a Search Field to Diviโ€™s Secondary Menu

Without a search field, your siteโ€™s navigation is going to suffer. You can have the most robust browsing experience on the internet, but if your users canโ€™t search to find exactly what theyโ€™re looking for, you just might (and probably will) lose out on business. This tutorial will walk you through adding a search field to Divi and its secondary menu so that no matter what,ย  your users will always be just a few clicks away from everything they need.

Divi Search Field Preview

Desktop

desktop version of the divi search field

Mobile

mobile version of the divi search field

Upload and/or Edit Global Header

For this article, weโ€™re going to be using the free header/footer that goes along with our Grocery Delivery layout pack. You can simply download the .zip archive and extract the neededย .json file to your computer.

json file

After that, go into your WordPress dashboard and navigate toย Divi โ€“ Theme Builder. From there, you need to click theย up-and-down arrows icon to open the Portability options.

theme builder for the divi search field

In the new modal, click the Import tab and find theย .json file you downloaded. When youโ€™re ready, selectย Import Divi Theme Builder Templates to begin the upload.

importing files

At this point, youโ€™re ready to enter theย Global Header section of theย Default Website Template. Importing theย .json file should have automatically applied the freebie as the siteโ€™s global header.

global header

Add Search Field to the Secondary Menu Bar

Using the Divi Visual Builder, you should see something similar to this as your global header.

global header editor

The first thing that we want to do is make a space for the search field. We want to make sure the search field is easily available to all visitors, so weโ€™re going to add it to the secondary menu (above the Home/Contact row).

To start, we are going to add the search field using theย Divi Search Module to the third column of the first row.

search module in the third column

Placeholder text is important for search fields, so when your module is in place, go intoย Settings and set yourย Placeholderย text to something that reminds the user of what they can search for. We are puttingย Find Items! as the placeholder so the user knows thatโ€™s what they can search for since weโ€™re using the grocery delivery layout pack.

placeholder text inside the divi search field

The search field being in the third column isnโ€™t a good look. So we want to go into the Search module settings and go into theย Design tab. Find the Transform options and then navigate to theย Translate tab (the second one). You can then drag the search module into place, and Divi will handle all the CSS and spacing for it.

We are also using % for this value so that it stays relative regardless of the viewport on desktop. Usingย px can make it skew in some varying resolutions.

transform options

Diviโ€™sย Transform Translate options do need to be adjusted for mobile, too. If you donโ€™t, the same So make sure that you go into the Responsiveness settings and set the Search moduleโ€™s location under the secondary menu options. We just adjusted the vertical location for mobile because placing it in the third column of the row automatically displays it at the bottom of the rowโ€™s elements.

transform for mobile

ย  Style the Divi Search Module

While you donโ€™t have a lot of styling options for a search field, you do have a few. Namely the color of the text and field itself, both when itโ€™s inactive and when a user has clicked into it. (And spacing and sizing and other standard Divi design options, of course.)

To find the color options, navigate to the Field menu in theย Design tab. Once expanded,ย  you have the option to change the Placeholder text color, the Field background color, and the Field text color (user-entered text, that is). Additionally the focus variants are when the user is specifically interacting with the search field.

search field styling

When that is styled to your liking, click the save button.

Check The Visibility Settings

Some of our layout packs and freebie headers come with different display options for desktop and mobile enabled. If you see faded/greyed-out modules in the visual builder, that indicates the module is disabled on some devices.

For the grocery delivery header, the final two columns are disabled on mobile. We want to go into the Row settings and click into the settings for the columns you want to show on mobile. In this case, itโ€™s the third one.

row options

Then, go into the Advanced tab and navigate to theย Visibility options. Here, make sure that all the options underย Disableย are unchecked for the column containing your the search box. Click the save button (green checkmark), and the modules should appear in full-color and no longer be faded.

search field

Once youโ€™ve made sure everything is visible, youโ€™re ready to get this thing live!

Save Your Work

Be sure that you click the green save button in the lower-right of the screen.

saving your changes

Now youโ€™re ready to close out of the visual builder using the X in the upper-right corner. On the next screen, you will want to make sure the Divi Theme Builder has saved all of your options. If it saysย Save Changes, click the button. If it saysย All Changes Saved, then your search field is live in your Divi secondary menu already.

divi search field save changes

Final Results

The only thing now is to admire your handiwork on your site!

Desktop

desktop version

Mobile

mobile version

Wrapping Up with the Divi Search Field

Search fields are a fundamental part of having a good user-experience for your site. If you want to provide the best service you can for your visitors, then making sure that your content is searchable should be one of your top priorities. Hopefully, you can take this quick-and-easy method and apply it to your Divi site soon!

Divi Marketplace

Are You A Divi User? Find Out How To Get More From Divi! ๐Ÿ‘‡

Browse hundreds of modules and thousands of layouts.

Visit Marketplace
Divi Marketplace
Divi Cloud

Find Out How To Improve Your Divi Workflow ๐Ÿ‘‡

Learn about the new way to manage your Divi assets.

Get Divi Cloud
Divi Cloud
Divi Hosting

Want To Speed Up Your Divi Website? Find Out How ๐Ÿ‘‡

Get fast WordPress hosting optimized for Divi.

Speed Up Divi
Divi Hosting
Premade Layouts

Check Out These Related Posts

New Starter Site for Barbers (Quick Install)

New Starter Site for Barbers (Quick Install)

Posted on January 14, 2025 in Divi Resources

Divi empowers you to build the best websites possible, and now, Divi Quick Sites takes website creation to a whole new level. This revolutionary tool lets anyone, regardless of skill level, generate a complete website in under two minutes! Divi Quick Sites provides everything you need to launch...

View Full Post
New Starter Site for Electricians (Quick Install)

New Starter Site for Electricians (Quick Install)

Posted on January 7, 2025 in Divi Resources

Divi empowers you to build the best websites possible, and now, Divi Quick Sites takes website creation to a whole new level. This revolutionary tool lets anyone, regardless of skill level, generate a complete website in under two minutes! Divi Quick Sites provides everything you need to launch...

View Full Post
Divi 5 Update: Public Alpha Version 6

Divi 5 Update: Public Alpha Version 6

Posted on January 6, 2025 in Divi Resources

The Divi 5 Public Alpha is available for testing. If you use Divi 5, you’ll notice an update notification for Public Alpha Version 6 today. We release new Divi 5 versions every two weeks, and it gets better each time! If you haven’t tested Divi 5 yet, try it and let us know what you...

View Full Post

4 Comments

  1. Thanks for the nice post!
    It would be so much more useful if Divi’s search module was able to search woocommerce products too.
    Perhaps that will be in ETs next woo update.

  2. I believe our developer has just switched from Enfold to Divi for reasons of speed optimisation among others. I’ve yet to start using it as we’re in the process of re-doing our site. This layout looks quite confusing initially but I’m sure blogs like this will help. Thanks for putting it together and I hope I can get used to its functionality!

    • I am looking for a Page Builder for My Genesis site. I want to build the Homepage with Blocks in which I want to show the latest Blog Posts Category wise.

      Newspaper theme offers this kind of functionality. But, I donโ€™t want to use that Theme as it comes with visual composer which makes my site look great, but the page speed is not good.

      Can I build my site homepage similar to Newspaper theme using the Divi Builder?

      • Yes, you can use Divi for that.

Leave A Reply

Comments are reviewed and must adhere to our comments policy.

Join To Download Today