How to add a sidebar to a one-column theme? (7 posts)

  1. Moribus
    Posted 3 years ago #


    For my website I am currently using "PinBlack" theme (http://wordpress.org/extend/themes/pinblack), and by default, the index page has only one big column, and all the pages has a sidebar.

    I would like to add a sidebar to the index. I dont know how to make the width of the content smaller so the sidebar would fit, and I can't insert the "right" code in page.php so the sidebar can appear properly just like the other pages.

    Im out of ideas, and realy need some help! Thank you.

  2. W.P. Ginfo
    Posted 3 years ago #

    Please give the url of your site so we can give 'made to measure' advice.

  3. noahjonah
    Posted 3 years ago #

    1. Maybe find a different theme that has a "sidebar" option.
    2. Copy the code from that "sidebar.php"
    3. Start to manipulate from there

  4. Brian Harris
    Posted 3 years ago #

    Here's a quick hack to start you off...

    index.php @ line 5 change it to this <div id="content" class="col620">

    Then locate the closing div - </div> <!-- end #content --> and immediately below that add the sidebar thus <?php get_sidebar(); ?>

    You will then need to do some CSS adjustments to get the content/boxes containers just right for your needs

  5. Brian Harris
    Posted 3 years ago #

    OK just had a quick a look at the theme on my local install and for the index.php to mach the inner pages do this...

    Replace line 5 with this code:

    <div id="content" class="clearfix">
       <div class="col620 clearfix" role="main"> <!-- Our hack div -->

    Then to the other end replace the closing div with this code:

    </div><!-- Our hack closing div -->
        <?php get_sidebar(); ?>
    </div> <!-- end #content -->

    Now you should have do very minimal CSS hacks.

  6. Moribus
    Posted 3 years ago #

    Thank YOU Zulfikar, i was amazed how fast you responded and helped for me. I added sidebar and everything works.

  7. Brian Harris
    Posted 3 years ago #

    You are most welcome Moribus - glad to have been of some assistance.

    Please mark the thread as resolved.

Topic Closed

This topic has been closed to new replies.

About this Topic