• I’ve turned my menu bar so that each “page” is actually to the category and brings up all the posts concerning that category through the menu option under Appearance.
    In my sidebar I have this secondary widget area that I only want to show up on certain pages/categories. I know to write a php if else statement but the problem I’m getting stuck at is how the syntax is suppose to work in what exactly the variables are and what I am suppose to be calling.
    I’ve added the php code around my secondary widget area in the sidebar.php sheet that looks something like below but the entire sidebar goes missing so clearly there is something wrong :/

    <?php
    if ('cat=13') ?>
    secondary widget area code
    <?php endif; ?>

    Thanks for any help and sorry for my lack of php knowledge

Viewing 1 replies (of 1 total)
  • Thread Starter koager

    (@koager)

    I’ve also tried putting the If statement inside the div that calls the secondary widget area but it’s still turning everything off.

    <div id="secondary" class="widget-area" role="complementary">
    	<ul class="xoxo">
    		<?php
    		if (is_category('marketing') {
    			dynamic_sidebar( 'secondary-widget-area' ); }
    		?>
    
    </div>

Viewing 1 replies (of 1 total)
  • The topic ‘Parenting the sidebar to specific categories?’ is closed to new replies.