WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Hiding an element on all but one page with CSS

[Resolved] Hiding an element on all but one page with CSS

  • Right now, I have an image in my header that I only want to show up on one page.
    The image class is called IOTMonth and the page ID I want it to shop up on is 10717.

    Here is the only page I want it to show up on: Product page.

    I’ve read other posts about hiding certain elements on a single page but I couldn’t find anything relating to this.

    Thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey,

    You should be able to accomplish this with most themes by adding the following css to your site:

    .IOTMonth {display:none;} body.10717 .IOTMonth {display:block;}

    Thanks, it’s almost working. It’s hidden on all the pages but it’s not showing up on the page I need it to. I’ve tried:

    body.10717 .IOTMonth {display:block;}

    and

    body.page-id-10717 .IOTMonth {display:block;}

    Any ideas?

    I ended up doing:

    body.postid-10717 .IOTMonth {
    display:block;
    }

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Hiding an element on all but one page with CSS’ is closed to new replies.