Okay, I tried an if (is_single() && in_category('store--all'))
condition and I still get the same result.
add_filter('single_template', 'product_posts_no_sidebar');
function product_posts_no_sidebar() {
if ( is_single() && in_category('store-all') )
?>
<style>
#secondary { display: none; }
.site-content { width:100% !important; }
</style>
<?php }
And so I pulled that condition out and ran this:
add_filter('single_template', 'product_posts_no_sidebar');
function product_posts_no_sidebar() {
?>
<style>
#secondary { display: none; }
.site-content { width:100% !important; }
</style>
<?php }
Same result, so obviously my use of ‘single_template’ works as a default so that no matter what I put in, my sidebars disappear on all single pages and the content goes to 100%.
How do I get single pages to respond only to the categories I specify?
In reading the different filter tags, I’m wondering if someone could rewrite the explanations a little clearer and perhaps with examples.
For those who are newer, it might help them more.