3
webdesignai.com http://www.webdesignai.com/users-filter-posts-genesis/ Enable Users To Filter Posts in Genesis This guest post is written by Sophia Phillips, who has been working as a professional in WordPress Web Development Company and loves sharing information about leveraging multiple benefits of WordPress CMS in the best possible manner. Currently, she has an impressive count of WordPress development-related articles under her name.. I ran into this idea just a month ago, when I was working on a Genesis project. I'll explain it with an example: Let's say you have a travel website that is centered mostly on full-length articles by writers who are penning their travel sojourns to a particular place via different posts. Now, being a travel website, you also feel that it would be a good idea to feature certain cities in terms of reviews where you write about the directions to reach it, it's most recommended destinations, it's weather, it's rail and road connectivity and so on. So far, so good. But, when these reviews are published in the same space as the travel experiences of certain writers, your audience is bound to be mislead since they are accessing a post to read someone throwing light on their latest exploration and instead running into a standard “What the city is all about” review. The post navigational structure on the menu page can misdirect your visitors. So, the best alternative here is to find a way by which your audience can tell, even before accessing a post, whether it is a review or a detailed travel account of someone. This is where the flexibility of the Genesis the me comes into play. In Genesis, we have the “filter” function right under the theme settings area that gives us the freedom to place any text based on taxonomy (categories/tags) at the tail-end of our index page. And in order to make the required change in the genesis framework, we really don't have to indulge ourselves in a very complicated method. The latest Genesis version gives us a feature to filter the posts based on the older/newer filters and next/previous filters.

Enable Users To Filter Posts in Genesis -webdesignai.com

Embed Size (px)

Citation preview

Page 1: Enable Users To Filter Posts in Genesis -webdesignai.com

webdesignai.com http://www.webdesignai.com/users-filter-posts-genesis/

Enable Users To Filter Posts in Genesis

This guest post is written by Sophia Phillips, who has been working as a professional in WordPress WebDevelopment Company and loves sharing information about leveraging multiple benefits of WordPress CMS inthe best possible manner. Currently, she has an impressive count of WordPress development-related articlesunder her name..

I ran into this idea just a month ago, when I was working on a Genesis project. I'll explain it with an example:

Let's say you have a travel website that is centered mostly on full-length articles by writers who are penning theirtravel sojourns to a particular place via different posts. Now, being a travel website, you also feel that it would be agood idea to feature certain cities in terms of reviews where you write about the directions to reach it, it's mostrecommended destinations, it's weather, it's rail and road connectivity and so on.

So far, so good. But, when these reviews are published in the same space as the travel experiences of certainwriters, your audience is bound to be mislead since they are accessing a post to read someone throwing light ontheir latest exploration and instead running into a standard “What the city is all about” review.

The post navigational structure on the menu page can misdirect your visitors.

So, the best alternative here is to find a way by which your audience can tell, even before accessing a post,whether it is a review or a detailed travel account of someone. This is where the flexibility of the Genesis the mecomes into play.

In Genesis, we have the “filter” function right under the theme settings area that gives us the freedom to place anytext based on taxonomy (categories/tags) at the tail-end of our index page. And in order to make the requiredchange in the genesis framework, we really don't have to indulge ourselves in a very complicated method.

The latest Genesis version gives us a feature to filter the posts based on the older/newer filters and next/previousfilters.

Page 2: Enable Users To Filter Posts in Genesis -webdesignai.com

The Older / Newer Post Navigation Filter

Genesis has an extremely user-friendly dashboard that makes it a breeze to perform certain tweaks and thesecan be done under the Genesis Theme Settings. When you navigate this section further, you can find the ContentArchives wherein you can come across an option, “Post Navigation Technique”.

This option is already set to Older/Newer. Now, for you to be able to filter this option, you will need to add thefollowing code to the functions.php file of your child theme.

add_filter( 'genesis_older_link_text', 'gt_review_older_link_text' );function gt_review_older_link_text() {$olderlink = '« Older Reviews';return $olderlink;}add_filter( 'genesis_newer_link_text', 'gt_review_newer_link_text' );function gt_review_newer_link_text() {$newerlink = 'Newer Reviews »';return $newerlink;}

The Previous / Next Post Navigation Filter

There is no a great deal of difference between this filter and the previous one, except for the fact that it comes intoaction when the “Select Post Navigation Technique” is set to Previous/Next. For the record, you can find it underthe Content Archive.

Again, you have undesirable default output in the shape of “Previous Posts” and “Next Posts”. For you to be ableto filter it, you need to add the following code to functions.php file of your website's child theme:

add_filter( 'genesis_prev_link_text', 'gt_review_prev_link_text' );function gt_review_prev_link_text() {$prevlink = '« Previous Reviews';return $prevlink;}add_filter( 'genesis_next_link_text', 'gt_review_next_link_text' );function gt_review_next_link_text() {$nextlink = 'Next Reviews »';return $nextlink;}

That's all that was needed for filtering. And as I assured you, it was easy.

Filtering Using the Beautiful Taxonomy Filters Plugin

Now, among those who are reading it and wondering whether Genesis is truly a worthy framework apart from itscustomization capabilities, you need to understand that Genesis goes beyond them. The flexibility, however, is astandout feature that makes Genesis what it is and contributes to its ever growing popularity.

Page 3: Enable Users To Filter Posts in Genesis -webdesignai.com

Now, in an event that you wish to acquaint yourself with even greater number of methods and techniques forfiltering the custom posts, certain highly resourceful plugins like Beautiful Taxonomy Filters can be your go-totools. This plugin is surely a blockbuster one with its reliably excellent features and a surefire way of filtering yourcustom post types archives based on taxonomies. It can be made use of while filtering the CPTs.

The best part about the Beautiful Taxonomy Filters is that it lets you keep JavaScript aside – a welcome featurefor those who find JavaScript too unwieldy and complex (which, to be honest, most of us do).

The fact that the visitors can filter posts simply via the terms and categories is what makes this plugin even morerecommended. It also happens to be based on WordPress Plugin Boilerplate that allows you to organize thecodebase using the object-oriented approach.

There is no cap on the number of filters that the plugin can handle. It is also advised that you keep theunnecessary taxonomies out of the picture.

With such a massive range of features, Beautiful Taxonomy Filters is a must-have for any webmaster!

Let me know if I missed something or if you have any questions. Also, share with your friends.