How to add Find-As-You-Type Dropdown in WordPress Search

Posted on September 23rd, 2011 by in WordPress Plugins | 10 Comments  
How to add Find-As-You-Type Dropdown in WordPress Search

We’ve discussed several ways to make the WordPress search more useful. In this article we are going to show you how you can add a find-as-you-type dropdown menu using the Searchlight plugin. This extension will allow you to get instant results as you type into the search field similar to google.

First thing you need to do is install the Search Light plugin. Once you have activated it look under settings in your admin panel. You will see a button that says “Searchlight”. Clicking on this will bring you to a page where you can set everything up. First, you will notice that you can select a visual theme. You have four built in options: light, dark, clean, and lime. Those of you that are more advanced can also go into the plugin’s CSS file and make modifications there. Next, select whether you want post thumbnails to show in the results and specify the exact position where you would like the dropdown menu to appear. If you are familiar with CSS you will know that this section modifies the relative positioning. What that means is that when you put a positive number into the “top” field the dropdown will be moved that many pixels down from its previous position (offset from the top). A negative number, however, will move it up. The same goes for the “left” field. A positive number will move the dropdown to the right, and a negative number to the left.

searchlight menu

In the next section you have the option to change the text displayed in the search results panel. Although this is intended for translation (hence the section title) you can use it to make modifications as well. After you choose how many results you want to display the last thing you have to do is make sure that the Searchform ID and Input field ID are correct. The default WordPress values are already inputted but if you are using a modified theme you may have to go into your searchform.php file to get your IDs. This is important because if the values are wrong WordPress will not know where to attach the dropdown menu.

searchlight menu

After everything has been styled and you are done tweaking your settings, save your changes and you should see something that looks like this when you start typing into your search bar:

searchlight

Download Search Light Plugin

About

Editorial Staff at WPBeginner mainly Syed and David.

Post comment as twitter logo facebook logo
Sort: Newest | Oldest
Sai@Tech Genra 5 pts

wow ! really very nice step by step tutorial :)

Soundeasy 5 pts

When we go to http://wordpress.org/extend/plugins/search-light/

it just show

Whoops!

We couldn't find that plugin. Maybe you were looking for one of these?

that's why every body asking at..

ecentricmarketing 5 pts

Hi, Just read this post. Really interesting and great timing for myself! However, it seems that "Search Light" is unavailable. Any ideas why that might be?

upcloseafrica 5 pts

Another nice tutorial there. Could you make a tutorial on the sticky trending bar? Would love dat

abdelhafidcom 7 pts

come on ..... give us some thing without plugins ....

wpbeginner 60 pts moderator

abdelhafidcom What is wrong with this plugins??

mani0993 5 pts

That's a nice plugin. Any tutorial to get this done without a plugin ?

wpbeginner 60 pts moderator

Mani Viswanathan There is nothing wrong with using plugins. If you want to do it without a plugin, then simply copy the plugin codes and paste it in your functions.php file (which is again a PLUGIN!)

mani0993 5 pts

wpbeginner I know there is nothing wrong in using a plugin. But since we need core plugins (which are heavy) for other purposes it's better off to use min. codes instead.

wpbeginner 60 pts moderator

Mani Viswanathan You will end up using the same or similar code in your functions.php file to hook into the filters... This would result in the same usage... saving it in a separate file and calling it a plugin does not make a difference.

Tweets about us: