26th Jul '25
/
0 comments

Display External WordPress Posts using WP REST API

This Pro tutorial provides the steps for showing posts from any WordPress site using the WordPress REST API.

For this to work, the external (or can be the same) WordPress site must have the REST API enabled (it is, by default).

We shall add HTML, PHP and CSS for this in a Code element. As such, this is not specific to Bricks builder and can be used in any WordPress site. We just need to specify the URL of the external site and optionally, change the number of posts to display.

The posts will be in a responsive 3-column grid with each post having the category name(s), featured image, published date, title, excerpt and a read more link.

A separate tutorial will follow on how to do this using Bricks query loop and native elements like Basic Text, Image, etc.

Step 1

Add the following HTML & PHP in your page. If using Bricks, use a Code element.

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
Custom Mini Calendar using WordPress REST API

Custom Mini Calendar using WordPress REST API

This Pro tutorial provides the steps to use WordPress REST API to fetch posts of an Event CPT that have the same Event Date custom…
Categories:
Pro
Loading posts on click using WP REST API in Bricks

Loading posts on click using WP REST API in Bricks

This Pro tutorial provides the steps to load the title and excerpt of the post whose title has been clicked from a list of posts.…
Categories: