October 16, 2023

Create a Related Post Section with GeneratePress and GenerateBlocks

Play Video

Creating a Related Post Section with GeneratePress can elevate your website’s user experience by offering relevant content to your audience. This tutorial walks you through the process using GeneratePress Pro and GenerateBlocks Pro, focusing on their powerful features like Dynamic Block Elements and query parameters.


Prerequisites

Please make sure you have the following installed and activated:


Setting Up the Element Section

  1. Navigate to Appearance > Elements in your WordPress dashboard.
  2. Click on Add New and choose Hook as the element type.
  3. Name it “Related Posts Section” and set the hook location where you want the related posts to appear.

Creating a Post Content Template

  1. Navigate to Elements > Post Content Template.
  2. Open the existing template or create a new one.
  3. Add a new heading by selecting the Headline block.
    • Set the heading level to H3.
    • Type “You May Also Like These Posts…”

Adding Dynamic Content with Query Loop

  1. Navigate to Elements > Post Content Template.
  2. Add a new block and search for Query Loop from GenerateBlocks.
  3. Select a starter template, for example, a two-column layout.
  4. Set the number of posts to display to 2 or as desired.

Using Parameters for Dynamic Content

  1. Click on the Query Loop block.
  2. Add a parameter and choose Taxonomies.
  3. Select Current Post Terms to dynamically pull posts based on the current post’s taxonomy.

Excluding the Current Post

  1. Add another parameter in the Query Loop.
  2. Choose Exclude Posts.
  3. Select Exclude Current Post to ensure the current post is not displayed in the related posts section.

Randomizing the Displayed Posts

  1. Add another parameter in the Query Loop.
  2. Choose Order By.
  3. Select Random to randomize the posts displayed.

Related Post Section with GeneratePress – Conclusion

Creating a Related Post Section with GeneratePress is a straightforward process that can significantly improve your website’s user engagement. By using GeneratePress Pro and GenerateBlocks Pro, you can easily add dynamic, relevant content to your posts.

Required Resources

GeneratePress Logo
Free Options
GenerateBlocks Logo
Free Options
Credit to WPTuts
WPTuts is a popular YouTube channel dedicated to providing high-quality, easy-to-follow tutorials for WordPress enthusiasts, web designers, and developers. The channel features a wide range of topics, from beginner guides on setting up your first WordPress site to advanced tutorials on customizing themes and plugins, ensuring that there's something for everyone
Visit
Create a Related Post Section with GeneratePress and GenerateBlocks
Welcome back!
Enter your Helwp credentials to sign in.

No Account yet? Sign Up

My Account
Menu
Give Feedback
Describe your feedback *
Rate Helwp
Share
Facebook
Twitter
LinkedIn
Reddit
Email
WhatsApp
Telegram
Pocket
Report
Problem *
Describe the problem
Want us to reply?
Your E-Mail
Affiliate Disclosure

At Helwp, we’re committed to transparency and honesty. Therefore, we want to inform you that some of the links on our website are affiliate links. This means that, at no additional cost to you, we may earn a small commission if you click through and make a purchase.

We only promote products or services that we genuinely believe in. These affiliate commissions help us to maintain the website and continue to provide you with free, high-quality WordPress content.

If you are interested in how you can support us even further, check out our support page.