On the Single Page for my events, it defaults to having the sidebar on the right. Is there a way to make the Single Page use the 'full-width' page template?
add_filter('single_template', function ($single) { global $post;
// If is not part of plugin single pages return normal if (strpos($post->post_type, 'stec_') === false) { return $single; }
return get_template_part('single-custom');
});
Replace 'single-custom' with your full-width single page template.
The only issue is when I use this code, for some reason I lose a lot of the content on the Single Event page, such as the location, RSVP button, etc. The only thing that actually stays is the event description.
As an example, I included a before (with-sidebar) and after (no-siderbar) example.
Try the filter with priority number 9999. Example:
add_filter('single_template', function ($single) {
global $post;
// If is not part of plugin single pages return normal
if (strpos($post->post_type, 'stec_') === false) {
return $single;
}
return get_template_part('single-custom');
}, 9999);
On the Single Page for my events, it defaults to having the sidebar on the right. Is there a way to make the Single Page use the 'full-width' page template?
Hi,
Add this filter in your theme functions.php file:
Replace 'single-custom' with your full-width single page template.
Stachethemes Developer
Thank you - this has been helpful.
The only issue is when I use this code, for some reason I lose a lot of the content on the Single Event page, such as the location, RSVP button, etc. The only thing that actually stays is the event description.
As an example, I included a before (with-sidebar) and after (no-siderbar) example.
Hi,
Sorry for the delay.
I'll take a look at the filter again and will update you on the issue.
Stachethemes Developer
Try the filter with priority number 9999. Example:
Stachethemes Developer