• I am attempting to have a different sidebar display on my single.php page. No matter what I do, the same regular sidebar.php appears. I am wondering if I am doing this right.. If anyone can help, it’s most appreciated.

    Now I am trying to get a certain sidebar to appear on the single.php page.. Not the category.php page. I have it working fine on that.

    <div class="col-right">
    			<?php if ( is_category(10)) {
    				get_sidebar(aquatics);
    				} else {
    				get_sidebar();
    				}
    				?>
    			</div>
Viewing 1 replies (of 1 total)
  • assuming that you have a single.php, use ‘get_sidebar(different);’ in there.

    or similar to your code posted, try to use:

    <div class="col-right">
    			<?php if ( is_single()) {
    				get_sidebar(single);
    				} else {
    				get_sidebar();
    				}
    				?>
    			</div>

    and name the different sidebar ‘sidebar-single.php’

    http://codex.ww.wp.xz.cn/Conditional_Tags#A_Single_Post_Page

    or in combination:

    <?php if ( is_category(10)) {
    	get_sidebar(aquatics);
    	} elseif ( is_single()) {
    	get_sidebar(single);
    	} else {
    	get_sidebar();
    	}
    	?>
Viewing 1 replies (of 1 total)

The topic ‘Different Sidebar for the single.php template’ is closed to new replies.