Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created June 15, 2018 15:30
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 joshfeck/5244f2e9685b17013122cd2a81a7efa8 to your computer and use it in GitHub Desktop.
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
<?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