• Resolved Guido

    (@guido07111975)


    Hi JW,

    It might be a nice addition to add a feature so users can set a different default featured image, depending on the (custom) post type.

    So a default image for the native posts, another one for the “product” post type, another one for the “event” post type, etc.

    Guido

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jan-Willem

    (@janwoostendorp)

    Hi Guido,

    This is possible to do with a filter.
    Currently I’m not considering adding this as a feature.

    
    function dfi_posttype_book ( $dfi_id, $post_id ) {
      $post = get_post($post_id);
      if ( 'wiki' === $post->post_type ) {
        return 31; // the image id
      }
      return $dfi_id; // the original featured image id
    }
    add_filter( 'dfi_thumbnail_id', 'dfi_posttype_book', 10, 2 );

    See the faq for more examples

    Thread Starter Guido

    (@guido07111975)

    Thanks, and understood!

    Guido

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Feature request: image for each post type’ is closed to new replies.