1. Home
  2. Docs
  3. Plugin Features
  4. Business Directory
  5. Add Search Feature

Add Search Feature

Search Form Block

To add a search form to the top of your Business Directory page, simply add the Search Form block above your Business Directory Block as shown in the video below.

How to add search feature to Business Directory

Once you have added the search form block, you can set the alignment, add placeholder text, etc. using the search block settings. When you do a search using the search block, the search results will show up below the search field, on the same page. You can select which fields to show in search results using the block settings as well.

Search Results Page Display

By default, the search results page will display as a single column. Use the search block settings to create a multi-column display. 

Search Business by Name

Using the search form your website visitors can search your Directory by Business category, keyword in the description or Business name. Keep in mind that if you have opted to ‘hide lapsed members‘ using the Member Manager plugin, Directory listings that have been marked ‘lapsed’ will not appear in search pages.


Add A-Z Search to Business Directory

All you need to do to add an A-Z search feature to your Business Directory is to select the alpha search option in the Business Directory. ‘Additional Options’ block settings.

Search by Letter

Add A-Z search to Business Directory - Alpha Search

Category Quick Links

Search Directory by Category

You can use parent / child categories to add a responsive category display (as shown above) to your Directory. Another great way to make it easier for your visitor to find and connect with your members!


Filter by Category

To add a category filter option to your Directory display, select the filter by category option in the Business Directory block, ‘Additional Options’ settings.

Add filter by category search to Business Directory plugin

NOTE: A-Z search and Filter by Category can both be displayed on the page, but they cannot be used in combination.


Search Page Layout

Check out some gorgeous ideas for designing your search feature and Business Directory page here.


Troubleshooting

Search feature not working

If your search feature is not working:

Go to Settings >> Permalinks. Try setting your permalinks to ‘Post name’ instead of the default one.

How the Search Widget works

  • The Business Category Search pulls up all Businesses listed in the selected category.
  • The Keyword Search searches the Business title and description fields. Your search word must appear in one of these fields in order to be included in the keyword search results.

NOTE: Similar keywords are not included in the search. For example bakeries will not be included in a keyword search for bakery. However, if you use bakeries as a category, all the Businesses in that category will be shown on your search results page.


Setup Search for second language

If you are creating a multi-lingual Business Directory, you will need to use the shortcode setup below and setup 2 search features with 2 separate results pages. See more translation setup instructions here.


Add space to A-Z Search

To add space above or below the alpha search feature, add the following CSS code in your customizer:

Spacing for Alpha Search:

.alpha_listings {
padding-top: 30px;
padding-bottom: 50px;
}

(adjust as needed based on your theme)


Search Form Shortcode

Activate search bar for Business Directory

Step 1: Create a search page

Display a Business Directory search form on your association’s website, by creating a new page and inserting the following shortcode: [business_search_form].

The page with the [business_search_form] shortcode will display your search form. You can put the [business_search_form] shortcode anywhere on the site (including a sidebar widget).

Step 2: Create a results page

Next, create a separate page to display the search results using this shortcode: [business_search_results].

NOTE: You must use these two pages in conjunction, but on separate pages.

Step 3: Connect the search page to the results page

Add the required parameter – results_page=”name-of-results-page” – to your [business_search_form] shortcode. (Replace ‘name-of-results-page’ with the slug of your search results page.)

For Example: If the title of your search results page is ‘Search Results’, then the slug is probably ‘search-results’, and the shortcode for your search form should look like this [business_search_form results_page="search-results"]

How to Find Page Slug: To get the slug, of that page, navigate to the page in your dashboard. Edit the page. On the right, look for ‘Permalink’ section. Here you will see the page slug. Or, you can get the slug by viewing the page, and finding the part of the URL that comes after the last “/”.

How-to-find-page-slug-for-WordPress

Search Results per Page

The default number of search results shown is 5. You can change this to show more results per page or fewer results per page under CDsettings >> Directory.

Add Directory Search Widget

There is also a Business Directory Search widget. To add a Directory search to a widget area on your site, you also need to have a page with the [business_search_results] shortcode in it.

add search widget for Business Directory

Was this article helpful to you? Yes 3 No