Change Page Header on Custom Post Single Posts to show Category
-
I want to make the page header show the taxonomy term for the custom post type single post instead of the title of the post. I am trying to use the following code but it isn’t inserting the title in the correct place.
// Change page title on custom post type single posts function disable_title( $return ) { if ( is_singular( 'study_findings') ) { // 'study_findings' is the custom post type $return = false; $terms = get_the_terms( $post->ID, 'study' ); // 'study' is the custom taxonomy if ( !empty( $terms ) ){ // get the first term $term = array_shift( $terms ); echo $term->name; } } return $return; } add_filter( 'ocean_display_page_header', 'disable_title' );
Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Change Page Header on Custom Post Single Posts to show Category’ is closed to new replies.