Want to display recent blog posts on your homepage or landing page? This tutorial explains how to use the memberlite_recent_posts shortcode or the WordPress Query Loop block to show recent posts with full control over layout, filters, and styling. Whether you prefer using shortcodes or visual editing, you’ll find a flexible solution for showcasing content.

Recent Posts Example

Recent Updates From Our Blog

Recent posts to help you design, grow, and optimize your membership site.

Banner image for the We're Hiring a Sysadmin for Our Hosting Platform blog post. White Paid Memberships Pro icon with the text "New Job Posting Systems Administrator" over a dark tree-bark texture background.

We’re Hiring a Sysadmin for Our Hosting Platform

We’re hiring a sysadmin to work with us on the hosting platform at Paid Memberships Pro. This is a remote position for our fully remote team. If you’re worried about the title of sysadmin vs. SRE vs. something else, you’re probably not a good fit for the role or our company. Titles and responsibilities are (more…)

Banner image for the How to Create a Free Membership Site blog post — woman at a desk managing her small business with a laptop, overlaid with the post title in white Poppins text

How to Create a Free Membership Site

Most successful membership sites do not start by asking people to pay. They give something away first, whether that is a newsletter, a starter course, or a small community, and earn the trust that makes a paid tier possible later. If you are building your first membership site, a free tier is the fastest way (more…)

Shortcode Attributes

  • author_id: The specific author’s posts to display. (optional; default: all authors; accepts: current, a numerical ID, or a user’s nicename/username)
  • category_id: The single post category ID to display. (optional; default: shows all posts)
  • count: The number of posts to display. (optional; default: shows 3 posts)
  • post_type: The Custom Post Type to display. (optional; default: ‘post’)
  • show: Show the post content or excerpt. (optional; default: excerpt)
  • show_avatar: If no post thumbnail is set, show the author avatar. (optional; default is “yes”)
  • subtitle: the text for a subheading displayed before the posts output.
  • title: The text for a heading displayed before the posts output.

Shortcode Example

Using the WordPress Query Loop Block Instead

If you’re building your homepage or landing pages with the Block Editor, you can use the Query Loop block to display recent blog posts, no shortcode required.

Why Use the Query Loop Block?

Use the Query Loop block if you:

  • Want more control over the layout and design of recent posts.
  • Prefer editing visually without touching shortcodes.
  • Need to filter or sort posts in more flexible ways.
  • Are building reusable block patterns or templates.

How to Add a Query Loop Block

  1. In the Block Editor, click the + icon and search for “Query Loop”.
  2. Select a prebuilt layout (e.g. Grid, List, or Image + Text).
  3. Customize block elements like:
    • Post Title
    • Post Excerpt or Full Content
    • Post Date
    • Featured Image
    • Author avatar (with Post Author block)
  4. Use the block settings sidebar to:
    • Control the number of posts (matches count).
    • Filter by category or author.
    • Set sort order, pagination, and layout settings.
Screenshot showing how to add a Query Loop block in Gutenberg

Match Memberlite Shortcode Behavior

Shortcode AttributeQuery Loop Equivalent Setting
countPosts per page
category_idFilter → Category
author_idFilter → Author
title / subtitleAdd Heading or Paragraph blocks above loop
showUse Post Excerpt or Post Content block
show_avatarAdd Post Author block with avatar enabled

Last updated on April 1, 2026


Was this article helpful?
YesNo