Creating a custom category page in WordPress when using the Genesis Framework

The WordPress Genesis framework is an excellent and reliable source of themes designed around a proprietary framework from StudioPress.  You can’t use any Genesis themes without buying them, but you’re not just buying a theme, you’re buying access to their framework, which in many ways makes a lot of WordPress functions and customizations easier while sometimes making certain customization more work than the standard WordPress workarounds.

In the below code example,  ‘cat’ is used as the category ID.  You can also access the global object wp_query:

  • cat (int) – use category id.
  • category_name (string) – use category slug (the end child URL of the category)
  • category__and (array) – use category id.
  • category__in (array) – use category id.
  • category__not_in (array) – use category id.
<?php
/**
 *
 * Template Name: Custom Category 1
 * This file modifies the genesis loop
 *
 */

remove_action('genesis_loop', 'genesis_do_loop');
add_action('genesis_loop', 'custom_cat_loop');

function custom_cat_loop() {
    global $query_args;  // wp_query() args
    $args= array('cat' => '11');
    genesis_custom_loop(wp_parse_args($query_args, $args));
}

genesis();

?>

StudioPress backs their themes and framework and has excellent support.  Their themes are very reliable, I have updated a few Genesis frameworks and their related plug-ins never without an issue.  Under the hood, they are encapsulated, mostly object-oriented, so they’re not prone to those fatal errors and other weird things that may happen when loading plug-ins and themes from other sources.  WordPress is funny that way — they don’t have very high standards for code conventions and quality, so you need to rely on the WordPress community’s reviews, ratings, and actually see how popular the theme or plug-ins are.  You may find a diamond in the rough, and by all means explore the other options, but StudioPress takes the guess work out of “will this break everything?  Will it crash my site?”

If you’re in a dev environment and experimenting, that’s one thing.  If you’re on a tight deadline to launch a site, that’s another.  Go with the tried and true.  I personally love the Twitter Bootstrap framework because it is light weight, fully responsive, and has so much flexibility right out of the box, but StudioPress does a great job building responsive into many of their themes out of the box as well.  They do their homework, so unlike some independent themes you may buy for WordPress, StudioPress offers a wide variety of themes at very affordable prices.  There is a learning curve if you decide to go with StudioPress, but if you’re not planning on too much customization with your website, your StudioPress theme will accommodate most of your needs without delving into the cod, building your own templates, or refining custom loops.  That is, until your art director gets involved…. 🙂

About Author:

Senior Cloud Software Engineer and 25+ years experienced video production, video editing and 3D animation services for a variety of global clients including local video production here in Jacksonville, Florida.

Leave a Comment

Your email address will not be published. Required fields are marked *