This tutorial shows you how to filter your posts by category on any archive page type in Genesis without reloading the archive page.
Firstly, here’s 1 example of how the filter looks in a custom widget area that only displays on archive type pages:
Here’s the demo video:
The demo video shows you how the filter only displays on archive type pages and not single posts/pages.
The filter enables you to sort posts by category on any archive type page including any page using the blog page template, front or home page, category, tag, author and search archive pages.
Step 1: Install the FacetWP plugin
Step 2 : In your WordPress Dashboard go to Settings > FacetWP > Facets and click Re-Index
Step 3 : Add the following PHP code to the end of your child themes functions.php file.
You can change the location of the filter categories widget simply by changing the hook in the code from genesis_before_sidebar_widget_area to any other genesis hook.
Step 4 : Add the following code to a text widget in your Filter Categories widget area:
Note : You can make FacetWP-powered pages load quicker with page caching.
This tutorial was published in reply to this question from a member of the Genesis community:
Help! I’m trying to create a recipe index with WP Facet on a Genesis Sample theme, and I’m really struggling. I tried several tutorials and I can’t get anything to work. I know people have successfully done this (without having it integrated into a theme), but I’m not sure where to go for help.
Add Facetwp Pagination
Pagination will not work for paginated results without using Facetwp pagination.
To do this, you’ll need code to remove the genesis pagination and replace it with the facetwp template pagination using the following code for members:
Leave a Reply
You must be logged in to post a comment.