Last active
April 25, 2017 20:58
-
-
Save bpmore/f315a79758ea6634affc8cc24018db9a to your computer and use it in GitHub Desktop.
Remove the link from post titles in a specified category or taxonomy.
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
//* 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