You might not aware of why to allow the users filter posts and pages in WordPress. In this article we’re going to tell you the easy method of allowing the users to add filter posts to their WordPress site.
What’s the purpose letting user Filter Posts & Pages?
WordPress is having many categories and tags to use as an easy way for you sorting contents into topics. But users can view only one category, tag or archive page at one time and also shows one post type. If you want your users to be able to filter content in more than category or tag, this kind of filtering could be quite helpful while having a lot of content.
How to allow users filter Post & Pages?
For allowing users to filter posts and pages easily, you have to notice our following important instructions. The first point is that you have to install and activate the Search & Filter plugin. After the activation the plugin will be able to add a new menu item that’s labeled Search & Filter to your WordPress admin bar. If you click on it, so it will get you to the plugin’s usage page with full documentation how showing how to use plugins.
Now the Search and Filter plugin comes along with a shortcode that can accept various parameters to display the filtering options. There is a shortcode that you can use in post, page and inside a text widget.
[search and filter fields=”search, category, post_tag”]
The shortcode can also be used like a template tag in your WordPress theme files for example:
<php echo do_shortcode(‘[search and filter fields=”search, category, post_tag”]);?>
So it will show you the filtering options with search, category and tags fields. The plugins by default accepts the search, taxonomy, post_type and post_date as fields. Now we are going to show you another example in which we’ll include category, tags, post types and date fields. Here you have to use the shortcode like given below;
[search and filter fields=”search, category, post_tag, post_type, post_date”]
In case you are using different fields, types and heading then you have make sure that items are similar for each parameter. Here you have got another example in which we will add category, tags and post type fields with different headings and form field types.[searchandfilter headings=”Post type, Category, Tag” types=”checkbox, select, select” fields=”post_types,category,post_tag”]
Finally you are supposed to refer to plugin’s documentation page for having many ways for the shortcode. Finally you can use the shortcodes inside the text widgets. That’s all, we hope that you get easily understand how to allow users filter posts and pages in WordPress. For more information you can visit to our site at WWW.INTERNETSEEKHO.COM.