Support is closed now. We shall check all on 20th May 2024.

Premium add-on for Bricks Builder

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 WP Query from the next dropdown.

Custom WP Query
Custom WP Query

Enter the following code inside the code editor.

<?php
$args = [
	'post_status' 		=> [ 'published', 'future' ],
	'posts_per_page' 	=> 6,
	'post_type' 		=> 'post',
	'date_query' 		=> [
		[
			'after' 	=> date('Y-m-d',strtotime("-1 days")),
			'inclusive' => true,
		]
	]
];

return $args;
?>

Next, you will use the Image, Post Title, Post excerpt, etc nested elements and build your post card. If you will use the Heading and Basic Text element with a dynamic tag feature, you will use the following tags for the post title and permalink: {bu_post_title} and {post_permalink}.

Note: If you will create the custom post-type list, you will change the “post_type” parameter with your CPT slug.

Fills In: 
Tags:

Leave the first comment

Search Tutorials

Request TutorialsFeatures Request