1. Home
  2. Docs
  3. Plugin Features
  4. Business Directory
  5. Category Pages

Category Pages

Business Category Pages

Display list of Business Categories

To display a list of business categories on your site, create a page and insert the following shortcode: [business_categories]

The [business_category] shortcode defaults to a single column, list view.

Pro Tip: The formatting for your category pages is determined by your theme. To update formatting for your category pages, you will need to edit the category template in your theme.

Responsive Grid Display

Business Directory plugin, search by category responsive display

To create the Search by Category Grid Display shown below, first create both parent and child categories for your Business Directory.

Then add the format=”grid” parameter to your shortcode.  This will take create a responsive layout using both parent and child categories that will be similar to our demo site in structure, and will use the formatting from your active theme.

Check out Live Demo

Category Shortcode Parameters

This category shortcode also includes the following additional parameters:

orderby

Change the order in which the categories are listed.

Options:

  • name (default)
  • count (number of businesses in the category)

Example: [business_categories orderby="count"]

order

You can use this to determine whether categories are listed in ascending or descending order.

Options:

  • ASC (lowest to highest)
  • DESC (highest to lowest)

Example: [business_categories orderby="count" order="ASC"]

showcount

Show the number of businesses in each category

Options:

  • 0 – (default – the number will not display)
  • 1 – number of businesses displayed

Example: [business_categories showcount="1"]

hierarchical

Display categories and sub-categories in a nested list

Options:

  • 0 (all categories and subcategories will be in one alphabetized list)
  • 1 (default – subcategories will be nested under their parent categories)

Example: [business_categories hierarchical="1"]

hide_empty

Display empty categories, or only categories that actually have businesses in them

Options:

  • 0 – empty categories will be displayed
  • 1 – (default – empty categories will not display)

Example: [business_categories hide_empty="1"]

child_of

Display only categories that are a child of a given category.  Use the ID number of the category whose children you want to display.

Example: [business_categories child_of="27"]

exclude

Exclude a certain category.  Use the ID number of the category you want to exclude.

Example: [business_categories exclude="45"]

Please Note: These parameters affect the page displaying your list of categories only.  When you click on a category, your theme determines the layout of the category page that is displayed. In order to update this, you will first need to create a category page template.

For more control over how your directory is displayed, try the [business_directory] shortcode with the category parameter.


Category not linked to Directory

Category pages not linking to Business Directory individual listing pages?

If your category pages are not showing up, try setting your permalinks to ‘Post name’ instead of the WordPress default.

  • Go to Settings >> Permalinks.
  • Under ‘Common Settings’, choose Post.
  • Be sure to save your changes.


Category page layout doesn’t look like Directory pages

WordPress category pages are displayed using a template from your theme. The theme’s author may have created a specific category page template such as category-id.php, or category.php. But if they have not, the theme’s archive.php or index.php page may be used.

A simple way to solve this is to use a Chamber Dashboard theme. Our themes have been designed specifically for use with our plugins and to give all of the pages on your site a polished, professional look.

You could also create your own category page template.


More on how WordPress category pages work…


Was this article helpful to you? Yes No