Created
September 15, 2021 19:43
-
-
Save lelandf/4e4d1c1cd1f30ac84da4872bbf3e4332 to your computer and use it in GitHub Desktop.
Venue archives in The Events Calendar
This file contains hidden or 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 | |
// 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