My site has the following structure where one column is for the main content (articles) and the other one, on the right, is for the sidebar (primary sidebar).
The theme allows me to change the layout to three-col, however it's a "side-wide" change. I don't want three columns on main content section.
Is there a way to show this second sidebar only on category pages?
Here is the code for the secondary sidebar:
<?php
/**
* Alternate Sidebar Template
*
* If a `secondary` widget area is active and has widgets,
* and the selected layout has a third column, display the sidebar.
*
* @package WooFramework
* @subpackage Template
*/
global $woo_options;
$selected_layout = 'one-col';
$layouts = array( 'three-col-left', 'three-col-middle', 'three-col-right' );
if ( is_array( $woo_options ) && array_key_exists( 'woo_layout', $woo_options ) ) { $selected_layout = $woo_options['woo_layout']; }
if ( in_array( $selected_layout, $layouts ) ) {
if ( woo_active_sidebar( 'secondary' ) ) {
woo_sidebar_before();
?>
<aside id="sidebar-alt">
<?php
woo_sidebar_inside_before();
woo_sidebar( 'secondary' );
woo_sidebar_inside_after();
?>
</aside><!-- /#sidebar-alt -->
<?php
woo_sidebar_after();
} // End IF Statement
} // End IF Statement
?>
I think there are a few ways to achieve this:
1) We use a conditional function to display the secondary sidebar (which should be on the left of main content) only on category pages. 2) We can disable the secondary sidebar on the single pages. 3) Use CSS to disable sidebar (not sure if this can cause hidden content issue)
I wonder if this sounds logical (unfortunately, I am not a "coder")
Appreciate your help.