Created
September 5, 2017 09:16
-
-
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.
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
<?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