Created
June 15, 2018 15:30
-
-
Save joshfeck/5244f2e9685b17013122cd2a81a7efa8 to your computer and use it in GitHub Desktop.
Change Event Espresso Custom post type Archive titles by using the `get_the_archive_title` filter hook
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, except of course if you're starting with a blank file | |
function my_theme_ee_archive_titles( $title ) { | |
if ( is_post_type_archive('espresso_events') ) { | |
$title = 'Upcoming Events'; | |
} elseif ( is_post_type_archive('espresso_venues') ) { | |
$title = 'Locations'; | |
} elseif ( is_post_type_archive('espresso_people') ) { | |
$title = 'Staff'; | |
} | |
return $title; | |
} | |
add_filter( 'get_the_archive_title', 'my_theme_ee_archive_titles' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment