Slider nestable showcasing woocommerce and ACF gallery

Hello,
I am trying to get the nestable slider + Query Builder to showcase images form a gallery.

Option 1: Woo-Commerce Single Template.
I would like that the loop builder outputs the images from the woocommerce product gallery. I have set the post type to “media” & mime type to image, now all images are output in the slider.
How could I set it to only output the images from the woocommerce product gallery?
I suspect that I need to set the meta_query to the right key. Does anybody know how to get this working?

Option 2: The same, but this time for a single post template using a ACF gallery field.

Any help is highly appreciated!

Have been searching for the same thing. Hopefully someone knows how to and posts a solution.

Bricks support has helped with a solution.
Set the Query Builder to “Media”
and then add this code to a Code Snippet Plugin.

Change the $element_id == ‘fhmnfx’ & get_field(‘YOUR ACF-FIELD’)

<?php

add_filter( 'bricks/posts/query_vars', function( $query_vars, $settings, $element_id ) {
    if ( $element_id == 'fhmnfx' && function_exists('get_field') ) {
        $query_vars['post__in'] = get_field('YOUR ACF-FIELD');
    }

    return $query_vars;
}, 10, 3 );


1 Like