Skip to content

Instantly share code, notes, and snippets.

@lelandf
Created September 15, 2021 19:43
Show Gist options
  • Save lelandf/4e4d1c1cd1f30ac84da4872bbf3e4332 to your computer and use it in GitHub Desktop.
Save lelandf/4e4d1c1cd1f30ac84da4872bbf3e4332 to your computer and use it in GitHub Desktop.
Venue archives in The Events Calendar
<?php
// Adjust args
add_filter( 'register_post_type_args', function( $args, $post_type ) {
if ( 'tribe_venue' === $post_type ) {
$args['has_archive'] = true;
}
return $args;
}, 10, 2 );
// Load post type archive template
add_filter( 'template_include', function( $template ) {
if ( is_post_type_archive( 'tribe_venue' ) ) {
$template = get_post_type_archive_template();
}
return $template;
}, 51 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment