Title: Featured images
Last modified: April 23, 2022

---

# Featured images

 *  Resolved [mcgrelio](https://wordpress.org/support/users/mcgrelio/)
 * (@mcgrelio)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/featured-images-154/)
 * Hi,
 * first thank you for this cute and smooth piece of software!
    I’m using it on 
   my personal blog where I need to show the content (tex and featured image) of
   specific post categories only to logged users.
 * I’m using the “Is a Post with category” condition which properly restricts access
   to post content but it’s not working for featured image which are still display.
 * Is it possible and how to hide also featured image of post of specific categories
   just to logged users?
 * Regards

Viewing 1 replies (of 1 total)

 *  Plugin Support [mark l chaves](https://wordpress.org/support/users/mlchaves/)
 * (@mlchaves)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/featured-images-154/#post-15606956)
 * Hey [@mcgrelio](https://wordpress.org/support/users/mcgrelio/),
 * Sorry for the delay. If you’re using the _custom message_ protection (versus 
   a redirect), you’ll see the featured image because:
 * 1) Content Control only restricts post-entry content.
 * 2) Featured post images are part of the post header, not the post-entry content.
 * The good news is that you can write custom JavaScript (JS) to hide the post featured
   image every time there’s a Content Control _custom message_ protection on the
   page.
 * Here’s an example that would work on the Twenty Twenty-One theme.
 *     ```
       (function() {
       	const elt = document.querySelector('.denial-message-wrapper');
   
               // If there's a Content Control denial message on this page, then
               // hide the featured image.
       	if (elt) { 
                   // Notes: Change the selector below to the one your theme uses
                   // for post featured images.
           	    document.querySelector('.post-thumbnail').style.display = 'none';
       	}
       })();
       ```
   
 * Your JS should go into the footer of your posts.
 * Learn more about adding custom JavaScript to your WordPress site in this guide.
 * [https://docs.wppopupmaker.com/article/84-getting-started-with-custom-js](https://docs.wppopupmaker.com/article/84-getting-started-with-custom-js)
 * Can you give that a try and let us know how it goes?
 * Thanks so much 🙂

Viewing 1 replies (of 1 total)

The topic ‘Featured images’ is closed to new replies.

 * ![](https://ps.w.org/content-control/assets/icon-256x256.gif?rev=2968535)
 * [Content Control - The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More](https://wordpress.org/plugins/content-control/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/content-control/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/content-control/)
 * [Active Topics](https://wordpress.org/support/plugin/content-control/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/content-control/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/content-control/reviews/)

## Tags

 * [featured image](https://wordpress.org/support/topic-tag/featured-image/)

 * 1 reply
 * 2 participants
 * Last reply from: [mark l chaves](https://wordpress.org/support/users/mlchaves/)
 * Last activity: [4 years, 1 month ago](https://wordpress.org/support/topic/featured-images-154/#post-15606956)
 * Status: resolved