Featured Image Size on Specific Posts

Posted in: Newspaper
Post count: 14

Hello! Is there any way to set the size of a featured image with CSS but by Post ID? We’re using the BadgeOS plugin for user achievements and must use the featured image but it’s huge when users click on the achievement. I was able to change the percentage width using live CSS but it changes all of the featured images and I can’t figure out how to target just one post. The plugin is using the single.php template, so tried setting the Badges up as CPTs and assigning a cloud template to it that I’ve created but it’s not working. Given that, I figured I would set the featured size by post since we don’t have that many. Any guidance would be truly appreciated. Thank you!

Post count: 35449

Hi,
Yes, this can be done, you need to set the post id, this can be get from here -> https://i.imgur.com/GaEhLmC.png and here -> https://i.imgur.com/VWqYN2A.png all you need to do is to use this class .postid-16156 (replace the id with you post id) -> https://i.imgur.com/R1LcU3R.png
This code need to be set in theme panel> custom code> custom css.
Hope it will help you!
Thank you!

Post count: 14

Great — thanks so much! The CSS provided didn’t work straightaway so I tweaked a bit based on inspecting the element and it worked. Modified code is below in case anyone else inquires.

.postid-111111 .td-post-featured-image {
display: none;
}

Thanks, again!

Post count: 35449

Hi,
I’m glad that you manage the situation, is look that my example was for the featured background image and you have a normal featured image, sorry for that!
Have a nice weekend!
Stay safe!

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.