Hide sidebar and top menu in posts of a certain category
-
Hi, we have a certain category of posts. Whenever the user views a single post of that category (single.php) we want the rightmost sidebar of wordpress and the top wordpress menu to be hidden.
This is what I tried but to no avail:I found out the ID code of the category; in single.php I changed this line
<?php get_sidebar( ‘single’ ); ?>To:
<?php if ( !( is_category(‘6713‘) ) ) { ?>
<?php get_sidebar( ‘single’ ); ?>
<?php } ?>and in header.php I changed:
wp_nav_menu($params);To:
?php if ( !( is_category(‘6713‘) ) ) { ?>
<?php wp_nav_menu($params); ?>
<?php } ?>But this simply doesn’t work, the code is ignored, I think the is_category (or in_category, I also tried) simply always returns FALSE or something like that, because it isn’t in the scope of the inside category variable that would return a proper answer. That’s my theory (because when I put a hard coded condition in the IF, such as IF 3>4, this does work) How can I do this simply, without creating custom types, custom DW FOCUS template copies, or the like? its just a very simple change, I don’t want to make a mountain out of it.
Thanks
PS Using WordPress 3.9.1 and focus 1.0.8. But this is a fundamental wordpress issue, I believe.
- The topic ‘Hide sidebar and top menu in posts of a certain category’ is closed to new replies.