Thread Starter
lee990
(@lee990)
Just thought i would add, i did try this in fuctions.php but it left a white space..
// disable featured image for pages.
if ( ‘page’ == get_post_type() ) {
$status = false;
}
return $status;
}
add_filter( ‘dfi_thumbnail_html’ , ‘disable_feattured_image_for_posts’ );
}
Hi Lee
Yes you can with a small bit of code.
Put in in your theme functions.php or create a small separate plugin.
function dfi_posttype_page ( $dfi_id, $post_id ) {
$post = get_post($post_id);
if ( 'page' === $post->post_type ) {
return 0; // invalid image id
}
return $dfi_id; // the original featured image id
}
add_filter( 'dfi_thumbnail_id', 'dfi_posttype_book', 10, 2 );
Let me know how it goes!
Jan-Willem
Hi Lee,
You’re using a differens filter. And get_post_type() might not always use the correct post.
WOW, that was fast,
Don’t get used to it 😉
Glad to help.
Thread Starter
lee990
(@lee990)
Awesome – Don’t worry, I won’t. Have a great day!, btw, do you offer custom work?
-
This reply was modified 6 years ago by
lee990.
-
This reply was modified 6 years ago by
lee990.
The code worked for me too, thanks!