[resolved] Hiding an element on all but one page with CSS (4 posts)

  1. cccoryy
    Posted 2 years ago #

    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.

  2. BeardedGinger
    Posted 2 years ago #


    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;}

  3. cccoryy
    Posted 2 years ago #

    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;}


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

    Any ideas?

  4. cccoryy
    Posted 2 years ago #

    I ended up doing:

    body.postid-10717 .IOTMonth {

Topic Closed

This topic has been closed to new replies.

About this Topic