I’m trying to hide the footer from non-home pages. Below is what I have tried, This is the website
.home #first {
width:950px;
margin-top:20px ;
border-top: 1px dotted #9bacd4;
background:#ff0000;
}
.home #first img {
margin:5px;
}
.home #first h3
{
font-size:16px;
font-weight:bold;
margin:5px 0px 15px 15px;
}
#first {
display:none;
}
Both of your CSS rules
.home #first
and#first
are used. If you have overlapping properties, the most specific wins. So in this case adddisplay:block
to.home #first
selector and it will override thedisplay:none
, as.home #first
is more specific.You should set it to hidden first and then display it on a specific condition, for example on the homepage:
I would put a class in the tag of your home page that says something like .
Assuming your footer block has something like or you could then use CSS to specify that the footer is only visible on the Home Page.
Should work!
Use the
is_home()
function reference to control where you display your footer.Read the documentation.