Display popular posts in bricks

We will display the popular posts(most viewed posts) with the bricks loop builder. If you don’t want to use a plugin, then you can use this method. Storing Views Counter in The Custom Field Open the functions.php of the bricks child theme or drop the following code into the 3rd party snippets plugin. Once you have used this code, every time a user visits the single post page, the custom field wpbu_post_views_count will be updated.  Note: If you are using a caching plugin, then this method will not work by default. You…

Continue Reading

Display only sticky posts with the loop builder

In this tutorial, I shall show you how you will list the all sticky posts with the bricks loop builder. Make sure that you installed the BricksUltimate add-on and activate the Ultimate Query Builder option from your Dashboard -> Bricks -> BricksUltimate -> Misc tab. Now add one element of these container, block, and div elements to the canvas and enable the loop option. Select the Query -> Type -> Ultimate Query Builder -> Custom WP Query provider. Drop the following PHP code in the code text box and create…

Continue Reading

Displaying today’s post with the Bricks loop builder

BricksUltimate has a Custom Wp Query loop builder. With it, you can create your own custom query. Here we will use the “date_query” args and filter the WP Query loop. BricksUltimate released the Post Grid element. You can use this element or use the native bricks container/block/div element to build the posts list. Select the “Ultimate Query Builder” from the Query -> Types dropdown and choose the Custom WP Query from the next dropdown. Enter the following PHP code into the code box. It will fetch only today’s post(s). If you are getting the wrong post title and permalink, you…

Continue Reading

Displaying the posts from today’s date

Here we shall display the posts which are published today or later. You know that BricksUltimate has a custom wp-query loop builder provider. With this option, we shall create our custom query args and build the query. Here we will use the “date_query” args and filter the post’s WP Query loop. BricksUltimate recently released the Post Grid element. You can use this element or use the native bricks container/block/div element and enable the loop option. Select the “Ultimate Query Builder” from the Query -> Types dropdown and choose the Custom…

Continue Reading

Creating a listing section with the Metabox checkbox list and loop builder

We are creating a list with the help of the Metabox checkbox list field type and controlling them in our dashboard. Now we shall display them in list format with the Bricks List element and loop builder at frontend. See the video below

Continue Reading

Adding the post’s CSS classes in the loop builder element

We can add the post classes into the loop builder element wrapper. By default, the bricks loop builder is not adding the post classes. If you have the BricksUltimate add-on, you will get {post_class} dynamic tag which is fetching all CSS classes of that particular post. With this CSS class, you can differentiate your posts and add a unique style(if you need it). Before After

Continue Reading

Adds custom attributes to the popup wrapper

How do you add your own custom attributes to the popup outer wrapper? Here I am sharing a simple snippet. You will add it to the theme’s functions.php file or any 3rd party snippet plugin. bricks/popup/attributes is a filter. It is accepting the two parameters: attributes in array format and popup id in integer/string format. In the above code, I targeted the specific popup with the popup ID. You will replace the ID 7042 with your popup id. Here I am adding a custom CSS class and data attribute. You…

Continue Reading

Add attributes to BODY tag

You can easily add your own custom attributes to <body> tag. There has a filter bricks/body/attributes. Open the functions.php file of the bricks child theme or any 3rd party snippets plugin and drop the following PHP code Reference: https://forum.bricksbuilder.io/t/how-can-i-add-an-id-to-the-body-tag/11097

Continue Reading

Adding Quantity Input Field to Bricks Mini Cart element

The bricks builder has a native side cart element (Mini Cart) for the WooCommerce site. In this tutorial, I shall show how we can add the quantity field with the ‘+’ and ‘-‘ buttons there. So the customer can easily update the cart item’s quantity from there without any page refresh. Step 1: Adding the Quantity Input FieldAdd the following PHP code to your site. You can use the Bricks Child theme’s function.php file or any 3rd party snippets plugin like WPCodex.[edd_restrict id=”12,14,2474,3068,96772,98850,98847,98844,98841″ message=”Customers of BricksUltimate addon can view this…

Continue Reading

Sync AJAX Action with the Bricks Native Popup Builder

Bricks Builder integrated the lightbox effect with the Popup Builder feature. But it does not AJAX option. If your site has a long listing page and you added the lightbox option via native popup builder, your page size is growing big and increasing the DOM size. We can avoid it with AJAX. Because AJAX is fetching the dynamic data from your server without any page refresh. Therefore, your page will load quickly. BricksUltimate, a 3rd party add-on of the bricks builder added this feature and you can easily set up…

Continue Reading