You can organize all listings into different categories using directorist categories and display them to your users in an organized way.
Adding a listing category
At first, you need to create a listing category before assigning a listing to it. You can create a listing category in two ways: 1. From Directorist Listings > Add New Listing page while adding a listing, 2. From Directorist Listings > Directorist Categories page. The main difference between these two places regarding adding a category is that you will be able to add an icon and an image to any listing category in the Directorist Category page while you can not do the same in the Add New Listing page. This is why we recommend creating all listing categories from the Directorist Categories Page.
Go to Directorist Listings > Directorist Categories page and give a name to your chosen category. Adding a slug is optional as WordPress will generate this from the name field automatically. Choose a parent category if you want to organize by a parent-child hierarchy. The description field is optional. From the Category Icon dropdown, select an icon for the category. You can also search for an icon. Directorist uses Font Awesome icons. So, you can search a category icon by Font Awesome icon names. If you wish, you may add an image to the category by clicking the ‘Add Image’ button on that page. The category image will be visible only on the page with the shortcode [directorist_all_categories] and Grid view layout ( you may also display categories in a list layout. Keep reading for more info on this later in the page). Once you have created the number of categories you wanted, you can assign them to any listing during adding a listing either from the front-end or the backend dashboard.
Displaying all listing categories
You can display all listings categories using the shortcode [directorist_all_categories]. Use this shortcode inside any page content to display all categories in a single place.
Customizing the options of directorist categories
You can also customize how the categories are displayed in the category archive page very easily.
Go to Directorist Listings > Directorist Settings > Categories & Locations Page tab. Customize any options in the category section according to our need and save the changes. Visit the listing category archive page and you should see the changes have taken effect. Check out the screenshot below for a visual guide.
A quick overview of all categories options
- Default View: It lets you customize how to display all listings categories in the archive page. Available options are Grid and List.
- Number of Columns: You can display all categories in your desired number of columns using this option. Accept values: Number/integer.
- Sub-category Depth: When displaying all categories in a list-view, you can decide the number of the depth of sub-categories to display under a parent category. Accept values: Number/integer.
- Categories Order By: You can fetch and display categories by an order. You can order them by ID, Count, Name or Slug.
- Categories Sort By: You can sort the categories either by ascending or descending order using this option.
- Display Listing Count: You can display the number of listings attached to a category using this option. Default is Yes.
- Hide Empty Categories: This option lets you hide any category that does not have any listings attached to it. Default is No, which means empty category will be shown. But you can set it to Yes to hide empty categories on the listing categories archive page.
Displaying categories in a sidebar
You can display all listings categories using the Directorist – Categories Widget. You can use this widget from Appearance > Widgets page. Drag the Directorist – Categories widget to a sidebar eg. the Directorist – Listing Right Sidebar and customize the widget settings. Click save after customizing the widget and visit any listing details page. You will see categories are being displayed perfectly. Check out the screenshots below for more understanding.
If you rather prefer a video guide, check out our following quick video walkthrough.