Tutor LMS is a popular WordPress plugin that allows you to sell online courses using WooCommerce. In this guide, we are going to look at two ways you can add course filters to your course pages, a feature that doesn’t come natively with the plugin.
Method 1: Using Plugin Settings
In the plugin core update v1.8.4, Themum added the option to choose your preferred filter options on the course archive pages. This option allows you to filter courses by Keyword, Category, Tag, Difficulty Level, and Price Type.
To enable this option, follow the steps below:
- Go to the Tutor LMS settings accessible on the left pane on your WordPress dashboard
- Navigate to the “Course” tab to access the course settings
- Scroll down to the Archive settings and enable the “Course Filter” option
- Check the boxes below to select the filter options you wish to display on your courses page.
While this method is simple and available even on the free version of the plugin, it doesn’t give you complete control of your filter options. Sometimes, you might be looking to add more filter options to help your users further narrow down their search results. To do that, we need to get a little more creative.
Method 2: Adding a Custom PHP Page Template to your Theme Files
This method allows you to build an advanced sidebar course filter for your Tutor LMS plugin. Basically, we will bundle up the page template into a single PHP file and upload it to our theme folder. The template can then be called to define the layout of our courses page.
- First, head over to Github to access the page template PHP code using this link
- Copy the code and save it in a new file with the extension .PHP. You can alternatively toggle the ‘Raw’ option on Github and save the resulting page with an appropriate name such as “tutor-lms-filter.php”
- Using FTP or any other File Manager tool, go to your theme folder and upload the template file you saved above on the root
- Now edit your Courses page on WordPress and under “Page Attributes”, change your template to “Tutor Advanced Course Filter”
- Save the page and view
This method adds more filter options to your Tutor LMS plugin to help your users sort courses by Level, Topic, and Category. While this is a more advanced way to unlock features to the plugin, it has a few drawbacks.
For starters, this method might not work with all themes. In some rare cases, it might break your whole theme. For this tutorial, I used Astra Theme and it worked perfectly. Again, this custom page template is not very friendly on mobile. The filter options take up a lot of space at the top of the page in a vertical layout. Nonetheless, it’s still better than nothing 🙂
Credits to: Nayeem Parvez Chowdhury