Skip to content

Instantly share code, notes, and snippets.

@yanknudtskov
Forked from billerickson/archive.php
Last active February 7, 2019 12:44
Show Gist options
  • Save yanknudtskov/6dcdc242da18090d473cf3dbcc1e3a1d to your computer and use it in GitHub Desktop.
Save yanknudtskov/6dcdc242da18090d473cf3dbcc1e3a1d to your computer and use it in GitHub Desktop.
Removing advanced custom fields from the frontend
<?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