How can I hide a div (which contains an image) for a specific WordPress page?
I believe my page id is 46:
Here is the div I am trying to change:
<div id="static-footer-image" style="position:absolute; bottom: -15px; z-index: 501;">
<img src="images/background-bottom.png"/>
</div>
And the associated CSS code in my main CSS file:
#static-footer-image body.page-id-46 {
display: none;
}
It is still showing. What do I do to fix this?
Guess from the URL structure, your
%postname%
permalink structure is active. So, a bit of internal CSS can help alternatively, and the syntax isin_page('page_slug')
:Use following CSS
and make sure “page-id-46” class is applied to body tag and Clear the cache. May be try on another browser or a incognito window.
If that’s the page ID, the selector should be
not
You may have a
display
in CSS so you may try:This works for me:
not this:
After body give a space and type
.page-id-46 #static-footer-image{display: none;}
Once again check whether it’s a class or id.
in my case, it’s an id, here is my code for your reference:
Hope this will help you.
How would the code look if you wanted to exclude a widget?
The CSS: