Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@juanfra
Created August 3, 2021 15:18
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 juanfra/45e13fbf18614e2669c8bd9a75a8503c to your computer and use it in GitHub Desktop.
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.
<?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