-
-
Save yanknudtskov/6dcdc242da18090d473cf3dbcc1e3a1d to your computer and use it in GitHub Desktop.
Removing advanced custom fields from the frontend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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