How to Add the Simple Post Filter in WordPress

How to Add the Simple Post Filter in WordPress

It is a fact that WordPress allows you to classify the posts into different topics so that you are able to better manage your content. However, it is not convenient for your users to find the content in an easy and quick way because they are limited by one tag/category/custom taxonomy page by default. To achieve a better using experience, you can give users more freedom to filter for post types by adding the simple post filter into your WordPress site.

Especially if you include photo galleries and product lists on your website, you are advised to take the post filter into consideration. Because things will be much more complicated if you mess up your website, the article tries to present you with an easy way to get the desired effect without the need to edit code.

Step 1: Install and Activate Beautiful Taxonomy Filters.

In our experience, you’d better give preference to an exclusive plugin which can make things much easier. If you have not found a useful plugin, we would like to recommend the Beautiful Taxonomy Filters plugin which has achieved better than 4.5 out of 5 stars and served more than 4,000 websites. Certainly, you need to install and activate it on the result screen of Plugins > Add New at first.

Step 2: Configure the Plugin.

Upon activation, it is time for you to land on the Settings > Taxonomy Filters page where you have the freedom to customize your taxonomy filtering. At the beginning, you need to select the post types which you want users to filter on. Alternatively, you can decide which taxonomies are excluded to activate the filter. An attention is that you are not able to see any results if you do not sort your posts by different taxonomies.

Basic Settings

When you have finished your configurations, do not forget to save you changes. If you have no desire to change the settings for fine tuning your filter modules, there is no need for you to navigate to the “Advanced options” section which will work as default.

Advanced Options

Step 3: Add the Simple Post Filter in WordPress.

As a whole, there are two locations available for you to add the simple post filter into your WordPress site: One is via the archive.php file in your template and the other is to use widget. We will have a further discussion on how you can get the job done.

Below is the code snippet available for you to add it in your archive.php file. Since different themes can come with different layouts of archive.php, you are advised to try some locations if the function fails to work normally. If everything goes well, the filter will be displayed on the top of your screen.

Add Filter Code

On the Appearance > Widgets page, you should drag and drop the widget “Beautiful Filter” in order to showcase the filter in the sidebar area.

Add Widget

Wrap Up

Besides the simple post filter, you can display your posts in alphabetical order by following this tutorial which also helps your users access the content quickly.