How can i remove featured image link in my single posts ?
I want to keep the featured image on the blog archive page but not on the single post pages.
https://mvservice.de/news/ >> this page is OK.
I Included in the enfold child functions.php following code:
Code snippets:
//——————————————————–
// PHP function – Remove featured image on all post page
//——————————————————–
function wordpress_hide_feature_image( $html, $post_id, $post_image_id ) {
return is_single() ? ” : $html;
}
// add the filter
add_filter( ‘post_thumbnail_html’, ‘wordpress_hide_feature_image’, 10, 3);
This code only removed the featured image but not the link with the placeholder image
Next step: I tried from Kriesi Documentation following change:
Remove featured image link from single post
To remove featured image link on single post, please add following code to bottom of Functions.php file of your child theme in Appearance > Editor
add_filter(‘avf_post_featured_image_link’,’av_remove_featured_image_link’);
function av_remove_featured_image_link(){
if(is_single()){
echo get_the_post_thumbnail( $current_post[‘the_id’], ‘featured’ );
}
>> This code removes the the featured images on the archive page !! and in the single post pages the link with placeholder image is still visible.
Can you help?
Hey Manfred,
Thank you for the link to your site, I added this to your child theme stylesheet:
#top.single-post .blog-meta {
display: none;
}
now this will not show on single posts but will continue to show on your archives, please clear your browser cache and check.
Best regards,
Mike