Show User’s Liked Posts in Bricks with WP ULike

This Pro tutorial shows how posts liked by the currently logged in user via WP ULike can be shown on a Page in Bricks.

Step 1

Install and activate WP ULike.

By default, the plugin will be active for the post post type. To change this, go to the Content Types tab in the plugin's settings page and select your desired post types in the "Post Types Filter" field.

While there you can change the appearance of the like button and any others settings as needed.

Step 2

The default button position on single posts is after the content.

You may want to add a top margin to space it out a bit.

Edit your single post template with Bricks and add this at Settings (gear icon) → PAGE SETTINGS → CUSTOM CODE → Custom CSS:

.wpulike {
	margin-top: 2em;
}

Step 3

View a few posts on the frontend and like them so we have some data for testing.

Create a Page called "My Profile" or "My Content" for showing the posts that the user has liked.

Add a Section and inside its Container Posts element or set up a Query Loop.

Use the query icon to select your post type. If this is for the built-in post post type, there is no need to make any changes since it is the default in Bricks.

If you'd like to add the like button in the loop, add this shortcode:

[wp_ulike]

Step 4

Let's filter the posts from the above to only those that the current user has liked.

Add this in child theme's functions.php 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 526 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
Posts Grouped by Authors in Bricks

Posts Grouped by Authors in Bricks

This Pro tutorial for Bricks users provides the steps to loop through users and inside that, through posts whilst setting the inner query's author parameter…
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…