• Hi everyone ,

    I’m pretty new to wordpress and i have done a small work in wordpress . This might be a stupid question but i’m stuck here.

    Heres the particular situation . I have sidebar on homepage which on the right side of the page which is default. But i want that my sidebar in inner pages should be on left side. Means on homepage side bar is on right and inner pages the sidebar should be on left.
    work can be viewed here https://chiromail.com.au/purematrix.com.au/

    Can somebody help me with this? or this kind of thing is possible in wordpress or not ? or any hack for it ?

    Please help.

Viewing 1 replies (of 1 total)
  • Hi

    Pretty easy to do. You will have to tweak the padding and margins a bit when done but this will move the sidebar around as you want.

    In your theme folder /wp-content/themes/{themename}/
    change header.php…

    change this <body> to this
    <body<?php if(is_front_page()) echo ' id="homepage"'; ?>
    save the file

    make a copy of style.css (for backup)
    open style.css and change this
    (line 591)

    #sidebar {
    margin-left:538px;
    padding:9px 0 10px 0;
    width:203px;
    }

    to this:

    #sidebar {
      float: left;
      padding:9px 0 10px 0;
      width:203px;
    }
    #homepage #sidebar {
      float: none;
      margin-left:538px;
      padding:9px 0 10px 0;
    }

    change this (line 260)

    .narrowcolumn {
      float:left;
      margin:0 0 0;
      padding:0 0 20px 45px;
      width:450px;
    }

    to this

    .narrowcolumn {
      float:right;
      margin:0 0 0 0;
      padding:0 0 20px 45px;
      width:450px;
    }
    #homepage .narrowcolumn {
      float: left;
      margin:0 0 0 0;
      padding:0 0 20px 45px;
    }

    Again, you will need to tweak the padding and/or margin. I added the current settings into both versions of the content and sidebar area to make it easy for you to adjust the ones that need adjusting.

Viewing 1 replies (of 1 total)
  • The topic ‘how to add sidebar?’ is closed to new replies.