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

    (@janwoostendorp)

    Hi,

    yes you can:

    function dfi_randomimage ( $dfi_id, $post_id ) {
      // how you fill this array with image id's is up to you.
      $allowed_image_ids = array( 1, 23, 45 );
    
      $random_image_id = $allowed_image_ids[array_rand($allowed_image_ids)];
      return $random_image_id;
    }
    add_filter( 'dfi_thumbnail_id', 'dfi_randomimage', 10 , 2 );

    If you need any more help let me know.

    Thread Starter serpwiz

    (@serpwiz)

    Thank you so much!!!! Works great!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Random Images’ is closed to new replies.