• Resolved agamb

    (@agamb)


    Hello! I am just curious how I can add a sidebar to a certain category page so I am able to display an archive list on the right? I have already copied the theme file and am editing the copy. I want the full page width for every page except this one. The page will have A LOT more entries when I am done.

    the direct link to the page on the website that I want the sidebar is

    https://www.chandos.com/commentary/category/archives/

    I have read so many different options that I have confused myself. Any help would be greatly appreciated. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Michael

    (@alchymyth)

    I have recently done something similar but for a page template:

    A Sidebar Template for a Page in the ‘One-Column’ Layout in Twenty Eleven

    you might be able to adapt that;
    – just ignore the page template code;
    – use a different conditional statement in sidebar.php:
    if ( 'content' != $current_layout || is_category('archives') ) :
    – and in the functions code:
    if( is_category( 'archives' ) ) :
    – also edit this if you need the sidebar on the left:

    $classes[] = 'left-sidebar';
    $classes[] = 'two-column';
    $blacklist = array('one-column','content','right-sidebar','singular');

    if you have problems or questions, please post here again.

    Thread Starter agamb

    (@agamb)

    That seemed to work as the layout is now different. The only issue now is that the sidebar isn’t displaying the archives widget…

    Michael

    (@alchymyth)

    have you edited sidebar.php?

    and changed the conditional statement near the top (line 13)?

    from the original:

    if ( 'content' != $current_layout ) :

    to the edited:

    if ( 'content' != $current_layout || is_category('archives') ) :

    Thread Starter agamb

    (@agamb)

    I double checked and I had edited the wrong conditional statement. It is working now! Thank you so much for all of your help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Sidebar on category page with one-column default’ is closed to new replies.