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 );
I really don’t want the featured images to appear on pages. The code above removes it from everywhere.
Hello,
Glad to hear you figured this out 😉
no, I didn’t. It was for your convenience, I only want to remove default featured from pages, the above code removes from everywhere.
Sorry, I didn’t see your reply.
I think you have a typo in the code.
You renamed the function to dfi_posttype_page but in the add_filter you still have dfi_posttype_book.
Can you try that?
Let me know
Jan-Willem
Ann
(@akg-free)
Hi Jan-Willem,
I’m not hrithik951, but for our project it works like charm. 😉
Thank you for your great plugin! 🙂