Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created September 5, 2014 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save billerickson/80e6b1f532daa069782f to your computer and use it in GitHub Desktop.
Save billerickson/80e6b1f532daa069782f to your computer and use it in GitHub Desktop.
<?php
/**
* Category Subtitle
*
*/
function be_category_subtitle() {
// Make sure this is a category archive
if( ! is_category() )
return;
$category = get_term_by( 'slug', get_query_var( 'category_name' ), 'category' );
$subtitle = esc_html( get_option( 'category_' . $category->term_id . '_be_subtitle' ) );
if( $subtitle )
echo '<p class="subtitle">' . $subtitle . '</p>';
}
add_action( 'genesis_before_loop', 'be_category_subtitle' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment