I would like to take all my images from a post’s “Image Advanced” type custom field and put them into a Nestable Slider. The slider would display one image at a time. Currently I can only display a grid of images from my custom field, but not loop through all of the images individually.

Metabox Custom Field Type: Image Advanced
Where the client can easily add and order all images:
How do I dynamically pull all the images from the custom field into the slider? This is what I’m trying to create:

I’m open to alternative solutions that get the same result.
I know HTML & CSS and very very basic Javascript. (Brick’s documentation gives an overview of custom php queries but doesn’t really show an absolute php beginner like me key details on how to implement it.) Hopefully there’s a solution that doesn’t require custom php for this problem or a good tutorial/documentation that explains Brick’s custom php queries for absolute beginners.
Thanks for the help!
As far as I know, this is not possible w/o writing custom PHP unless you want to use a 3rd party plugin (BricksExtras).
After enabling PHP query editor for the query loop element, post__in
query parameter can be set to an array of the image IDs in the Image Advanced field.
Screenshot from Meta Box Image Advanced Field Images in Bricks Query Loop - BricksLabs (needs membership):
After that, image source can be set to {post_id}
to show the images.
1 Like
Thanks Sridhar!
I added the code snippet to the PHP Query editor but got these two errors on the page:
Warning
: foreach() argument must be of type array|object, bool given in
/home1/alcesedi/public_html/.website_ff267c0c/wp-content/themes/bricks/includes/elements/image-gallery.php
on line 263
Warning
: foreach() argument must be of type array|object, bool given in
/home1/alcesedi/public_html/.website_ff267c0c/wp-content/themes/bricks/includes/elements/image-gallery.php
on line 352
Did I make a mistake in the way I set it up?
1 Like