Skip to content

Instantly share code, notes, and snippets.

@bpmore
Last active April 25, 2017 20:58
Show Gist options
  • Save bpmore/f315a79758ea6634affc8cc24018db9a to your computer and use it in GitHub Desktop.
Save bpmore/f315a79758ea6634affc8cc24018db9a to your computer and use it in GitHub Desktop.
Remove the link from post titles in a specified category or taxonomy.
//* Remove the link from each post titles in a specific category
add_filter( 'genesis_post_title_output', 'uca_post_title_output', 15 );
function uca_post_title_output( $title ) {
if ( in_category( 'uncategorized' ) || in_category( 'category-2' )) {
$title = sprintf( '<h2 class="entry-title">%s</h2> ', apply_filters( 'genesis_post_title_text', get_the_title() ) );
return $title;
}
return $title;
}
//* For taxonomy use
add_filter( 'genesis_post_title_output', 'uca_post_title_output', 15 );
function uca_post_title_output( $title ) {
if ( is_tax('class_type')) {
$title = sprintf( '<h2 class="entry-title">%s</h2> ', apply_filters( 'genesis_post_title_text', get_the_title() ) );
return $title;
}
return $title;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment