31st Jul '25
/
0 comments

WordPress Posts using WP REST API in Bricks

WordPress Posts using WP REST API in Bricks

This Pro tutorial provides the steps to display posts from any WordPress site that has WP REST API enabled in Bricks builder using a custom query type.

This is the equivalent of the previous tutorial, but with the freedom to use Bricks elements like Basic Text, Heading and Image for visually building the posts layout.

Step 1

Add the following in child theme's functions.php (w/o the opening PHP tag) or a code snippets plugin:

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Get access to all 610 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
Ordering Posts by Terms in Bricks

Ordering Posts by Terms in Bricks

How to output upcoming events at the top and past events below in a single query loop in Bricks.
Categories:
How to List Your Posts Divided by Categories in Bricks

How to List Your Posts Divided by Categories in Bricks

In this tutorial, we'll learn how to display a list of posts divided by each category. The DOM tree Here is how I structured my…
Categories:
Pro
Related Posts by Taxonomy in Bricks

Related Posts by Taxonomy in Bricks

In the previous Posts Related by Current Post's Terms in Bricks tutorial, we showed how posts related to the current single post that have the…
Categories:
Pro
Events grouped by months within years based on event date custom field value

Events grouped by months within years based on event date custom field value

How to output events grouped by years and months using three nested query loops in Bricks.
Categories:
Pro
Posts from Random Categories in Bricks

Posts from Random Categories in Bricks

Updated on 31 Jul 2023 In BricksLabs Facebook group a user asked: How would you query 3 WordPress posts from 3 different categories with Brick…
Pro
Upcoming Events Grouped by ‘Month Year’ in Bricks

Upcoming Events Grouped by ‘Month Year’ in Bricks

A custom query loop type for showing future events based on a date custom field using three nested query loops.
Related Posts by Author in Bricks

Related Posts by Author in Bricks

Querying posts on single posts by the author of the current post.
Categories: