Trying to drop sidebars from specific single post categories
-
I’ve got a filter written to have the sidebars dropped when single posts display a certain category, so the content goes to 100% width. It works, except that it’s doing this to all single posts.
Could someone help me with the correct category call-up? I thought I picked up the correct structure from some samples of people using categories in filters, but I must be overlooking or missing something.
Thsnks!
add_filter('single_template', 'product_posts_no_sidebar'); function product_posts_no_sidebar() { if ( in_category('store-all') ) ?> <style> #secondary { display: none; } .site-content { width:100% !important; } </style>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Trying to drop sidebars from specific single post categories’ is closed to new replies.