Thumbnail on pages

Hi,

I’m interested in having a thumbnail for my website pages. When I insert an image to ‘featured image’ in order to do this, it does not appear on the page, nor as a thumbnail when I post on Facebook for example.
Note that I currently have the following code to prevent featured images to appear on posts:


.single-post .x-main .entry-featured {
display: none;
}


Similarly to my posts, I would like to get my pages to have a thumbnail (preview url), but not show the image on the actual page itself.

Thanks

Hi There,

To hide the featured image on your pages, please update the previous CSS to this:

.page-template-default .entry-featured,
.single-post .entry-featured {
     display: none;
}

Hope it helps :slight_smile:

Hi, thanks.

Unfortunately it does not seem to work, because the featured image does not show on both posts and pages, with or without the code you provided, or with the code I mentioned I had before. It just seems that the featured image element is not working at all.

Hi @Nati_Dayzz,

Sorry for the confusion, the issue is nothing to do with CSS. Please ignore that.

What you need to do is implement featured image on page type (it’s only applicable for post type by default) then please check this https://stackoverflow.com/questions/18248477/can-i-add-featured-image-to-a-page-wordpress/

And please note that page type uses page templates where featured image aren’t applicable.

Once done and implemented, you can then add featured image to your page and try sharing it on facebook.

Thanks!

Hi,

There is a batch of codes in the link you provided. Can you make it clear which one of them is right, or just paste it here?

Thank you,
Nati

Hey Nati,

Hope you’re well today.

The easiest way to do this is to install the Yoast SEO plugin and you should be able to set the preview image when you post the link on the social sites.

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.