I’m outputting a post with gallery and image fields, but am running into an issue where in some cases, all the image fields are returning a value of “1” instead of the actual URL, title, caption, etc values. The issue happens when I apply a date filter to the get_posts argument for a set of content, and only when the start date of the filter is more recent than the oldest of the images in my media library. For example, the oldest library image in is Dec. 1, 2014. If the start date of the filter is Dec. 2 or later, the values are all output as “1”. If the start date of the filter is Dec. 1 or earlier, all the values are displayed correctly.
A workaround I found for a custom image field seemed to work: