Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created September 5, 2017 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pebblo/8354c1cf76f1c48056b35d4378ad1611 to your computer and use it in GitHub Desktop.
Save Pebblo/8354c1cf76f1c48056b35d4378ad1611 to your computer and use it in GitHub Desktop.
If the theme uses the_archive_title() to output the archive title it will output something like: 'Archives: Events' on your event list, use this function to just output the title without the prefix.
<?php //Please do not include the opening PHP tag if you already have one
function tw_ee_get_the_archive_title( $title ) {
$ee_post_types = array(
'espresso_events',
'espresso_venues',
);
if( is_post_type_archive( $ee_post_types) ) {
return post_type_archive_title( '', false );
}
return $title;
}
add_filter( 'get_the_archive_title', 'tw_ee_get_the_archive_title', 20, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment