Created
April 12, 2018 05:32
-
-
Save reidelliott/0df758cb5f470578fc8f01322d1dbf25 to your computer and use it in GitHub Desktop.
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
/** | |
* Removes the "Archive" prepending category and custom post type archives | |
* @author Reid Burnett | |
*/ | |
add_filter( 'get_the_archive_title', function ($title) { | |
if ( is_category() ) { | |
$title = single_cat_title( '', false ); | |
} elseif ( is_tag() ) { | |
$title = single_tag_title( '', false ); | |
} | |
if( is_post_type_archive() ) { | |
$title = sprintf( __( '%s' ), post_type_archive_title( '', false ) ); | |
} | |
return $title; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment