Support

Account

Home Forums Add-ons Gallery Field Random Gallery Image with wp_get_attachment_image() Reply To: Random Gallery Image with wp_get_attachment_image()

  • Another option is to get the unformulated value from ACF. Since you’re going to generate the image yourself using wp_get_attachment_image(), there really is not point in having ACF do all the queries involved to get all that image data that you’re not going to use.

    
    $images = get_field('gallery', 'option', false);
    

    will return an array of image IDs