Support

Account

Home Forums Front-end Issues Show as many multiple images as there are in the same page

Solving

Show as many multiple images as there are in the same page

    • eadwig

    • July 11, 2019 at 3:16 pm

    Hello everyone

    I would like to show all of the images associated with a specific post in each single page. I understand that the_field[] can get the data associated with one field only and so can get_field_object[]. Based on this, how could you retrieve the image of each of multiple image type fields in a single page?

    Any advice would be appreciated.

    Thank you in advance.

    • James

    • July 14, 2019 at 1:58 am

    Hi There,

    Thanks for reaching out to us.

    For such an implementation, I would recommend that you make use of the get_fields function.

    https://www.advancedcustomfields.com/resources/get_fields/

    This function will return an array of all the field and value related to a specific post.

    You can then implement some code to filter and only return values for the image field type.

    Hope this helps.

    • eadwig

    • July 14, 2019 at 10:14 am

    Hello James

    Thanks for the suggestion. I’ve been looking for some code I could use to filter fields by field type across ACF Documentation with no luck. Does ACF natively support such functionality?

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.