Premium add-on for Bricks Builder

Creating the gallery page with the Bricks editor

Gallery

How do you make the gallery page if you have 50+ images? In this tutorial, I shall show you how you will make the gallery page with ACF(Advanced Custom Fields) plugin and Query Loop Builder of the Bricks builder.

The complete process is shown in the video. Check the video below.

Code for Custom Loop

<?php
$args = []; //default array

//* Getting the galleries
$gallery_ids = get_post_meta( 6163, 'gallery_images', true);
if( $gallery_ids ) {
	$args = [
		'post_type' => 'attachment',
		'post_status' => 'inherit',
		'posts_per_page' => 12, //* change the limit per page
		'paged' => max(1, get_query_var('paged', 1)), //* this is for pagination
		'post__in' => $gallery_ids
	];
}

//returning the args to WP_Query
return $args;

Note: I used the ACF in this tutorial. But you can also use Metabox or any custom field plugin.

Fills In: 

Leave the first comment

Search Tutorials

Request TutorialsFeatures Request