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

    (@janwoostendorp)

    Hi faina,

    Sorry I did not see this message before.
    You can set a different image per category with the following code:

    add_filter( 'dfi_thumbnail_id', 'dfi_category', 10, 2 );
    function dfi_category( $dfi_id, $post_id ) {
    // Set a different image for posts that have the 'cats' category set.
    // This will trigger first, if multiple categories have been set.
    if ( has_category( 'cats', $post_id ) ) {
    return 7; // cats img id.
    }
    // Set a different image for posts that have the 'cats' category set.
    if ( has_category( 'dogs', $post_id ) ) {
    return 8; // dogs img id.
    }

    return $dfi_id; // the original featured image id.
    }

    Let me know if you need help in adding this.

    Jan-Willem

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.