Code to remove featured image from child page?

  • Unknown's avatar

    Using the Sela theme — on my site I have a grid page with many thumbnails, leading to child pages. I do not want the featured image that is the thumbnail on the grid page to show up on the child page. Is there a code I can enter into the CSS so the featured image does not appear on the child page? I have about 25 child pages where I don’t want the featured image to appear.

    Any help is appreciated. Thanks!

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Hi there, can you point me to one of the pages? It sounds like you do not want to remove the featured images from ALL pages, so I’ll have to see what would be required in order to delete them from some only.

  • Unknown's avatar

    Yes, thesacredpath! So if you go to my site, http://www.starfishscholars.org, go under “Scholars’ Institute” to “TransformHER,” you’ll see my grid page. I have the thumbnail photos on that page. But if you click one and go to the child page, you’ll see that the featured image is showing up on the page at the top. I’d prefer to not have any of those featured images appear, on those 20-something pages.

    Thanks for the help!

  • Unknown's avatar

    I was thinking those where the pages you were talking about. The following targets only child pages, not parent pages.

    .page-child .entry-thumbnail img {
        display: none;
    }
    .page-child .entry-thumbnail {
        background: #fff;
    }
  • Unknown's avatar

    Hmmm… so that SORT of worked, haha. When I input that code it did remove the featured image from the child pages, but now the thumbnails are gone from the parent page also, with the grid formats, it’s just blank spaces.

  • Unknown's avatar

    Hmmm, sorry, I should have noticed that they also define “page-child” on the parent. I’ve looked through the CSS classes in the opening body and article tags, and we can still do it, but it will be a bit more work as we will have to use page ids. The following takes care of Alexia, Amanda, and Ariana. View the source for the remaining child pages and in the opening HTML body tag, get the page id selector and use the following as a guide to add the additional pages. Separate them by commas as I have done.

    .page-id-223 .entry-thumbnail img, .page-id-221 .entry-thumbnail img, .page-id-219 .entry-thumbnail img {
        display: none;
    }
    .page-id-223 .entry-thumbnail, .page-id-221 .entry-thumbnail, .page-id-219 .entry-thumbnail {
        background: #fff;
    }
  • Unknown's avatar

    Wow! Thank you so much for that, that is great.

    One more question: how do I locate the source codes for the child pages, so I can find the page id selector and then input those in the format you’ve so nicely given me??

  • Unknown's avatar

    You are welcome.

    The best way would be to use the web inspector built into your browser. You can read more about that and watch a very brief video in our How to Find Your Theme’s CSS support page.

  • Unknown's avatar

    I actually did manage to figure it out, and now the site looks great. Thanks again for the help!

  • Unknown's avatar
  • The topic ‘Code to remove featured image from child page?’ is closed to new replies.