Hello. I only want to display a side bar on my home page, and for all other pages I want the main content to fill the whole page. I have successfully inserted (into the page template);
<?php if (is_front_page() ) {get_sidebar(); }
else {} ?>
I have been playing with my CSS file for ages (trial and error) to figure out how to vary the width of the main content dependent on the presence of a sidebar, but this has only resulted in pushing the content above or below the side bar. Can any one help, please...
CSS File
@import url(calendarstyle.css);
body{
padding:0px;
margin:0px;
font-family:Trebuchet MS, sans-serif;
font-size:11px;
background:url(images/bg.gif) repeat-x top #4d4d4d;
}
img{
border:0px;
}
a{
color:#044d8b;
text-decoration:none;
}
.sub{
border:0px;
}
input, textarea{
border:1px solid #cecece;
font-size:12px
}
div#page{
width:780px;
text-align:left;
}
.pagetitle {color: #8a3132;}
/*header*/
div#page #header{
width:100%;
height:210px;
background:url(images/header.jpg) no-repeat top #FFFFFF;
}
#logo {
position: absolute;
top: 0px;margin: 0;
padding: 0;
background: transparent url(images/title.png) no-repeat 0 0;
width: 526px;
height: 167px;
overflow: hidden;
line-height: 1000px;}
/* h1 - TITLE if you don't want to use an image*/
#h1 {
position: absolute;
top:40px;
padding: 0 0 0 50px;
font-size: 1.45em;
color: white;}
#h1 h1 a {text-decoration: none;
color: #fff;
letter-spacing: -1px;}
#h1 a:hover {text-decoration: none;
color: #dbefff;}
#rss2 {
z-index: 2;
position: absolute;
top: 160px;
width: 763px;
text-align: right;}
#search {
position: absolute;
top: 15px;
font: Trebuchet MS, Verdana, Sans-Serif;
width: 763px;
text-align: right;}
#s { color: #ababab;
width: 115px;
font: Trebuchet MS, Verdana, Sans-Serif;
font-size:1.15em;
background: transparent;
border: 0px solid transparent;
}
#s:focus {
color: #3c3c3c;
width: 115px;
font: Trebuchet MS, Verdana, Sans-Serif;
font-size:1.15em;
background: transparent;
border: 0px solid transparent;}
#s:hover {
color: #3c3c3c;
width: 115px;
font: Trebuchet MS, Verdana, Sans-Serif;
font-size:1.15em;
background: transparent;
border: 0px solid transparent;}
/* Menu */
#tabs1 { z-index: 4;
position: absolute;
top: 165px; padding: 0px 0px 0px 22px;
float:left;
background:transparent;
font-size:14px;
line-height:normal;
font-weight:bold;
}
#tabs1 ul {
margin:0;
padding:0px 0px 0px 0px;
list-style:none;
}
#tabs1 li {
display:inline;
margin:0;
}
#tabs1 a{
float:left;
background: transparent url(images/menu.png) no-repeat right top;
margin:0;
color: white;
padding:0px 12px 3px 10px;
text-decoration:none;
}
#tabs1 a:hover {
float:left;
color: #4d4d4d;
margin:0;
text-decoration:none;}
/*header text*/
div#header_text{
width:100%;
height:181px;
background:url(images/header_text_bg.png) no-repeat top #FFFFFF;
}
div#header_text #header_text_title{
padding-top:25px;
padding-left:40px;
color:#FFFFFF;
text-align:left;
font-size:23px;
}
div#header_text #header_text_text{
padding-top:2px;
padding-left:40px;
color:#FFFFFF;
text-align:left;
font-size:10px;
font-family:Trebuchet MS, sans-serif;
line-height:18px;
width:55%;
}
/* blog*/
div#page #blog{
background:#FFFFFF /*url(images/allbg.gif) repeat-y top left*/;
}
/* Sidebar */
#sidebar {
float: right;
width: 180px;
padding: 0 0 10px 0
}
/* SLIDEBAR Box Style */
.calendar {
text-align:center;
color: #3b74a4;}
.calendar a:hover {
background: #3b74a4;
color: white;
}
.calendar td {
height:15px;
padding: 0px 3px 0px 3px}
.calendar td a {
padding: 0px 3px 0px 3px;background: #cfeeff;
display:block;
color:#3b74a4;
text-decoration:none;
line-height:15px;
}
#today {padding: 0px 3px 0px 3px; background: #3b74a4;
font-weight: bold;
color: white;}
.calendar td a:hover {
display:block;
color: white;
background: #3b74a4;
text-decoration:none;
}
.boxed ul {
list-style: none;
padding:0 0 0 0;
margin:0;}
.boxed a {
color: #044d8b;
border-bottom: 1px dotted white}
.boxed a:hover {
border-bottom: 1px dotted #65b5f9}
.boxed li
{ background: none;
display: block;
line-height:1.40em;
font-size:1.10em;
padding: 1px 3px 1px 15px;
font-weight: bold;
color: #e89642; background:transparent url(images/mmenu.gif) no-repeat top left;
}
.boxed {
margin: 0px;
}
.boxed .title {
height: 23px;
letter-spacing: 2px;
padding: 0 0 0 0;
text-align: center;
text-transform: uppercase;
font-size: 14px;
color: #FFFFFF;
background:#FFFFFF url(images/sli_title.gif) repeat-y top left;
}
/* Content */
#content {
background:#FFFFFF url(images/allbg.gif) repeat-y top left;
width: 730px;
margin: 0 auto;
padding: 0 35px 0px 15px;
}
blockquote {
margin: 5px;
padding: 0px 5px 5px 35px;
background: transparent url(images/blockquote.gif) no-repeat ;
}
/* Content */
#mainhome {
float: left;
width: 500px;
margin: 0 auto;
padding: 0 30px 0px 5px;
}
#main {
float: left;
width: 100%;
height: 100%;
margin: 0 auto;
padding: 0 30px 0px 5px;
}
/* Sidebar */
#sidebar {
float: right;
width: 175px;
}
.white
{color: white;}
/* Footer */
#footer {
height: 75px;
padding: 55px 0 0 0; line-height:1em;
clear: both;
color: #FFFFFF;
width: 780px;
margin: 0 auto;
font-size:0.95em;
background: #4d4d4d url(images/footer.gif);}
#legal {
margin: 0;
padding: 0;
text-align: center;
}
#link {
margin: 0;
padding: 0;
text-align: center;
}
#main a, #main a:hover, #main a:visited,
{
color: #3b74a4;
text-decoration:none;
}
#main h2 {
margin-bottom: .5em;
font-size: 1.6em;
text-decoration:none;
/*background: transparent url(images/title.jpg); repeat-x top ; */
padding: 7px 0px 5px 10px}
#main h2:hover {
text-decoration: none;
color: #3b74a4;
}
.post-author, .post-date, .post-comm, .post-time, .post-cath, .post-edit
{ font-size: 1em;
text-decoration:none;
color: #044d8b; }
.entry {text-algin: justify;
font-size: 1.10em;
color: #02171d}
.post-author {
padding: 0 0 3px 18px;
background: url(images/p_author.gif) no-repeat 0 0;
}
.post-date {
margin: 0 0 0 10px;
padding: 0 0 3px 23px;
background: url(images/p_date.gif) no-repeat 0 0;
}
.post-comm {
padding: 0 0 3px 20px;
background: url(images/p_commen.gif) no-repeat 0 0;
}
.post-time {
padding: 0 0 3px 18px;
background: url(images/p_time.gif) no-repeat 0 0;
}
.post-cath {
padding: 0 0 3px 20px;;
background: url(images/p_cat.gif) no-repeat 0 0;
}
.post-edit {
padding: 0 0 3px 3px;
}
.post{margin:0 0 25px 0;}
.post .info{
padding:2px 3px 3px 8px;
border:1px solid #ccc;
background-color:#f7f7f7;
font-size:0.9em;
color:#505050;
}
/* Comments Styling */
#comment {
margin-bottom: 1.5em;
padding-bottom: 1em;
border-bottom: 1px solid #700000;
font: Trebuchet MS, Verdana, Sans-Serif;
}
#commentlist li {
margin-bottom: 1.5em;
padding-bottom: 1em;
border-bottom: 1px solid #700000;
}
#commentform {
margin: 1em 0;
background: #ffffff;
width: 280px;
}
#commentform textarea {
background: white;
border-top: 1px solid #c8edff;
border-left: 1px solid #c8edff;
border-bottom: 1px solid #29a7e4;
border-right: 1px solid #29a7e4;
width: 280px;
}
#commentform textarea:hover {
background: white;
border-top: 1px solid #29a7e4;
border-left: 1px solid #29a7e4;
border-bottom: 1px solid #c8edff;
border-right: 1px solid #c8edff;
}
#commentform textarea:focus {
background: white;
border-top: 1px solid #29a7e4;
border-left: 1px solid #29a7e4;
border-bottom: 1px solid #c8edff;
border-right: 1px solid #c8edff;
}
#commentform #email, #commentform #author, #commentform #url {
font-size: 1.1em;
background: #fff;
border-top: 1px solid #c8edff;
border-left: 1px solid #c8edff;
border-bottom: 1px solid #29a7e4;
border-right: 1px solid #29a7e4;
width: 280px;
}
#commentform #email:hover, #commentform #author:hover, #commentform #url:hover {
font-size: 1.1em;
background: white;
border-top: 1px solid #29a7e4;
border-left: 1px solid #29a7e4;
border-bottom: 1px solid #c8edff;
border-right: 1px solid #c8edff;
width: 280px;
}
#commentform #email:focus, #commentform #author:focus, #commentform #url:focus {
font-size: 1.1em;
background: white;
border-top: 1px solid #29a7e4;
border-left: 1px solid #29a7e4;
border-bottom: 1px solid #c8edff;
border-right: 1px solid #c8edff;
width: 280px;
}
#commentform input{
margin-bottom: 3px;
}
.submit1{
width: 280px;
cursor:hand;
font-size:1.10em;
background: #fff;
border-top: 1px solid #c8edff;
border-left: 1px solid #c8edff;
border-bottom: 1px solid #29a7e4;
border-right: 1px solid #29a7e4;}
.submit1:hover, .submit1:focus{
background: white;
border-top: 1px solid #29a7e4;
border-left: 1px solid #29a7e4;
border-bottom: 1px solid #c8edff;
border-right: 1px solid #c8edff;}