Anonymous User 14254218
(@anonymized-14254218)
According to the documentation of the function which determines whether a thumbnail exists or not, there is a filter you can apply.
see: has_post_thumbnail
You can use the has_post_thumbnail
filter by pasting the following code into your functions.php
file of the theme (best to create a child theme when editing the functions.php file.
function has_post_thumbnail_ws21317($has_thumbnail) {
return !is_singular('post') && $has_thumbnail;
}
add_filter('has_post_thumbnail', 'has_post_thumbnail_ws21317');
-
This reply was modified 4 years, 5 months ago by Anonymous User 14254218.
-
This reply was modified 4 years, 5 months ago by Anonymous User 14254218.
Thanks @raqai — since I’m an amateur I was trying not to have to change anything in the theme code so that I could do without creating a child theme just for that (the rest is working fine), but I guess I’ll have to stop being lazy :p
-
This reply was modified 4 years, 5 months ago by forzaclaire.
Anonymous User 14254218
(@anonymized-14254218)
you could also use css to achieve this. be aware though, that the featured image will still be loaded in the background using only css.
Depending on your goals, both ways have their pros and cons. 🙂
.post-template-default.single-post .featured-media {
display: none;
}
Using the .post-template-default
class if you only want to apply the changes to the default template. You can use .single-post
or .singular
while the former will hide the thumbnail only on single posts sites and the latter will also hide them on pages and custom post types.
Usually I suggest using a child theme because it makes changing things way simpler. Considering you only need 2 files to create a valid child theme, the “overhead” is negligible since every change you make will most likely be future update proof because you do not actually change anything in the actual theme.
-
This reply was modified 4 years, 5 months ago by Anonymous User 14254218.
Child theme done and it works fine :-))) Thanks A LOT @raqai !