-
-
Save juanfra/45e13fbf18614e2669c8bd9a75a8503c to your computer and use it in GitHub Desktop.
Fix AR page when using some themes that mess up with the singular template.
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 | |
//* Do NOT include the opening php tag | |
add_filter( 'the_posts', 'tec_tickets_ar_page_themes', -5 ); | |
/** | |
* Fix AR page when using some themes that mess up with the singular template. | |
* | |
* @param array $posts The list of posts. | |
* @return array $posts. | |
*/ | |
function tec_tickets_ar_page_themes( $posts ) { | |
global $wp, $wp_query; | |
$template = tribe( 'tickets.attendee_registration.template' ); | |
// Bail if we're not on the attendee info page. | |
if ( ! $template->is_on_ar_page() ) { | |
return $posts; | |
} | |
// Set as singular if using hello elementor. | |
$wp_query->is_singular = true; | |
return $posts; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment