Wrapper.php not working with my url endpoint template
I've created an endpoint for listings listing/[company-slug]/trust and have a template for that page but it doesn't seem to go through wrapper.php. Do I need to call it directly somehow or load my template differently? Right now I've pasted header, footer, etc into the template to get it working but obviously I'd rather do it right with wrapper.php.
Here is the code that loads the template:
function ft_trust_template_redirect() {
global $wp_query;
// if this is not a request for trust or a singular object then bail
if ( ! isset( $wp_query->query_vars['trust'] ) || ! is_singular() )
return;
if ( $trust_template = locate_template( 'trust-template.php' ) ) {
load_template( $trust_template );
}
else {
echo "template error";
}
exit ;
}
add_action( 'template_redirect', 'ft_trust_template_redirect' );
Should I call something different than load_template or do I need to trigger a filter that is getting bypassed because I'm using an endpoint?