ACF Photo Gallery Field Code
-
Hi
This code worked to display ACF Photo Gallery Field images in a Bricks Builder image gallery. What do I have to change to make it work with ACF Galerie 4 (I already changed acf_photo_gallery() to get_field())
function bricks_acf_gallery($field_name){
//Get the ID of the portfolio item currently in loop
$portfolio_id = get_the_ID();
//Get the image array that is attached to this portfolio item
$portfolio_gallery = get_field($field_name, $portfolio_id);
//Get only IDs of these images as this is what Carousel and Gallery elements expect to get
$gallery_img_ids = array_column($portfolio_gallery, 'id');
return $gallery_img_ids;
}
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.