• Resolved eldervl

    (@eldervl)


    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)
  • Plugin Author Navneil Naicker

    (@navzme)

    Hi @eldervl,

    ACF Galerie 4 doesn’t support Bricks Builder, and we don’t have any insight into its implementation. Unfortunately, I won’t be able to help with this.

    Thanks!

    qbey

    (@qbey)

    The topic already marked as resolved, but how about this small change in your code:

    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_map(function($gallery_item) {
    return $gallery_item['attachment']->ID;
    }, $portfolio_gallery);

    return $gallery_img_ids;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.