Need DFI on one CPT only but appearing on posts
-
Hi, I’m using the excellent DFI plugin to allocate an image whenever there is no photo on this portfolio.
I used your recommended code to build the following:
// Default Feature Image // Set for Portfolio posts only function dfi_posttype_book ( $dfi_id, $post_id ) { $post = get_post($post_id); if ( 'portfolio' === $post->post_type ) { return 2307; // the image id of RWD logo } return $dfi_id; // the original featured image id } add_filter( 'dfi_thumbnail_id', 'dfi_posttype_book', 10, 2 );
but I have something wrong because this also sets the image for ALL posts without a featured image defined.
I understood hte code would allow only for CPT of ‘portfolio’.
Can you see what I am doing wrong?
Many thanks,
Phil.The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Need DFI on one CPT only but appearing on posts’ is closed to new replies.