I want to have the featured image as a thumbnail when I search for the post but I don't want the featured image to be on the actual post itself. Are there any plugins or edits to code that I can do?
I want to have the featured image as a thumbnail when I search for the post but I don't want the featured image to be on the actual post itself. Are there any plugins or edits to code that I can do?
Share Improve this question asked Sep 23, 2014 at 16:27 JamesJames 111 bronze badge 1- 1 Please edit and elaborate your question with more details, as from now on it's not clear how you want to do that. Possibilities can be: (1) Assigned a FImg, but don't display the image in single post, only on search results, (2) Assigned an FImg for search results and a different image for single post page, and show them accordingly... Please explain more. – Mayeenul Islam Commented Sep 23, 2014 at 16:59
2 Answers
Reset to default 1You can set the featured image on the post. That featured image will not be on the post content.
If it's showing on the post it's because your template is calling has_thumbnail() on the single.php or content-single.php.
If you need more help, please past the single.php or content-single.php code, or say which theme you are using.
Cheers, Diogo
You could use get_the_post_thumbnail or get_the_post_thumbnail_url to retrieve the featured-image/attatchment for the post.
As mentioned in this answer, look to your theme's single.php (or single-{post_type}.php) file and see if the post thumbnail is being output anywhere.
And also check other places where data from the posts you're wanting hide the thumbnails of might be output. The attachment image could be called from anywhere in the theme.
... it should be fairly straight-forward to find and remove any places the attatchment-images / post-thumbnails are being output on the website's frontend. - but ensuring that files are completely unaccessible unless logged in would be a different question.