WordPress.org

Support

Support » Themes and Templates » How to add a sidebar to a one-column theme?

How to add a sidebar to a one-column theme?

  • Hello,

    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.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Please give the url of your site so we can give ‘made to measure’ advice.

    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

    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

    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.

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

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

    Please mark the thread as resolved.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to add a sidebar to a one-column theme?’ is closed to new replies.