• I have links to certain blog categories in my main menu, but on those archives/category pages there is no sidebar. I don’t see any options in the Customizer to choose a layout or add a sidebar to these pages. How can I accomplish this?
    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,
    You can change teh default pages layout to Right sidebar or Left sidebar.
    This will make the categories page to have a sidebar.

    Do take a look at this post, which has a similar issue, but in reverse.
    https://www.ads-software.com/support/topic/remove-sidebar-in-category-pages/

    Do post your site url.

    • This reply was modified 8 years, 4 months ago by Menaka S..
    Thread Starter Rob Rusnak

    (@rrusnak)

    Thank you Menaka,
    I was able to get the layout to work, but the sidebar widgets do not show up on category pages.
    For instance:
    https://beta.jcyte.com/news-blog/

    The code I’m using…
    I am not sure how to adjust the values for content etc.

    add_filter('tc_global_layout', 'my_custom_layout' );
    
    function my_custom_layout( $layout ) {
    
        $my_layout_for_categories      = array(
            'r' => array ( 'content' => 'span9' , 'sidebar' => 'span3' ),
            'l' => array ( 'content' => 'span9' , 'sidebar' => 'span3' ),
            'b' => array ( 'content' => 'span9' , 'sidebar' => 'span3' ),
            'f' => array ( 'content' => 'span9' , 'sidebar' => 'span3' ),
        );
    
        if ( is_category() ) {
            $my_layout = $my_layout_for_categories;
        } 
    
        //sets new values for content and sidebar (checks if there are new values to set first)
        foreach ($layout as $key => $value) {
            $layout[$key]['content']   = isset( $my_layout[$key]['content']) ? $my_layout[$key]['content'] : $layout[$key]['content'];
            $layout[$key]['sidebar']   = isset( $my_layout[$key]['sidebar']) ? $my_layout[$key]['sidebar'] : $layout[$key]['sidebar'];
        }
    
        return $layout;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Category/Archives do not have right sidebar’ is closed to new replies.