How to get ACF gallery images as elementor container background images
I’m using ACF with elementor pro to manage some custom post types and some custom fields for the custom post types. I have created a gallery field and according to the ACF documentation I’m able to get it using get_field('portfolio_images_gallery');
.
Using the var_dump()
I’m able to see that the gallery field associated with the post is correctly displayed. At this point, since I have a complex layout, I want to be able to assign singular images gallery to each container I will select from the elementor flexbox. Is there any solution I can apply using php to achive this? I’ve done some researches but unable to find a solution for this. Another option I’m considering is to use a shortcode that will create the grid I need, but I need to alternate the layout every three column, how I can do this dynamically using a foreach
loop?