Display Posts Shortcode

The Display Posts Shortcode allows users to easily display listings of posts.

If you are using the Block Editor the Query Loop Block will do much of this, in a more visual way.

Add the shortcode in a post or page, and use the arguments to select based on tag, category, post type, and many other possibilities.

There are also some extra options to display something more than just the title: include_date, include_excerpt, and image_size.

You can also display the list in a Text Widget. See Embed Codes in widgets for details and examples.

For example [display-posts category ="news" ] will give you this:

display-posts-plugin

This technique is extremely powerful but can get tricky if you are trying for more advanced methods. The display-posts-shortcode Wiki on GitHub gives more details.


More Examples

[display-posts post_type="page" post_parent="743"]

Will show pages whose parent has the id of 743. This is the plugin page on this site.

A way to find out the id of a page: In the Post or pages list, hover over the post title and the id is in the link shown in your status bar:

Screenshot explaining how to get the id of a page from the page list.

Here we include an excerpt and the date and limit the number of posts to three.

[display-posts category ="releases" include_excerpt="true" include_date="true" posts_per_page="3"]

  • Glow Blogs Update May 2025 (5/28/2025) - Glow Blogs was updated yesterday. The Following Plugins were updated. Jetpack, Syntax Highlighter, WP Accessibility, Mega Menu, H5P, Youtube Embed , 3D Flipbook, Userway Accessibility, WP Draw Attention. The Plugin updates in the main as small fixes and compatibility with the latest version of WordPress. Jetpack Fixed: A problem with the Jetpack icon not being … Continue reading Glow Blogs Update May 2025
  • Glow Blogs updated April 2025 (4/24/2025) - Glow Blogs has just been updated to WordPress 6.7.2 This has not brought a lot of new features that users will notices but there are improvements in performance, security & accessibility. Most of the improvements to the editor are for the block editor and site editors, bringing some more features to many of the blocks and improvements to the site editor.
  • Glow Blogs October 2024 Update (10/24/2024) - Glow Blogs has just had a fairly large update. Glow Blogs is now using wordPress 6.6.2. This bring quite a lot of new features, especially to the Block & Site Editor. Quite a few plugins have been updated too.

And here we don’t have a list but put each post in a div.

[display-posts category="issues-news-2" include_excerpt="true" wrapper="div" posts_per_page="3"]

Additional CSS Issue - In the most recent update to Glow blogs we updated the version of Jetpack that we use. Jetpack no longer supports Additional CSS. This is no longer available from the customiser or in the Styles of the Site Editor. CSS already added to sites continues to function. Native WordPress support Additional CSS but not in … Continue reading Additional CSS Issue
Widgets in New Site Issue & Workarounds - There is a problem with the display of widgets when editing them. This only happens with a classic theme on newly created sites. It does not affect older sites. When a new site is created it comes with a pre-installed set of widgets. This is theme dependent. When you go to edit the widgets in … Continue reading Widgets in New Site Issue & Workarounds
Glow Blogs Twitter Changes - Twitter/X keeps changing the goal posts for integration with other systems. Recently they have stripped out most of the functionality for free third party use.

More Advanced Examples

We can cange the appearance by using some custom css, this is added via the Jetpack Custom CSS module.

[display-posts category="news" include_excerpt="true" excerpt_length="20" wrapper="div" posts_per_page="3" wrapper_class="examplecss"]

Glow Blogs Housekeeping 3 - On 1 May 2025 we archived older Glow Blogs that haven’t been used for a number of years.  Following this,… Continue reading Glow Blogs Housekeeping 3
Glow Blogs Update May 2025 - Glow Blogs was updated yesterday. The Following Plugins were updated. Jetpack, Syntax Highlighter, WP Accessibility, Mega Menu, H5P, Youtube Embed… Continue reading Glow Blogs Update May 2025
We would love to hear from you - The Glow Team are looking for feedback on Glow Blogs. As part of our ongoing effort to support education staff… Continue reading We would love to hear from you

CSS


/* for display posts shortcode page */
.page-id-1403 .examplecss .listing-item {
    width: 30%;
    float: left;
    padding: 3px;
}

.page-id-1403 .examplecss a.title {
    display: block;
    width: 100%;
    font-weight: bold;
    text-decoration: none;
    background: lightyellow;
    border: solid 1px #ccc;
}

.page-id-1403 .examplecss .excerpt-dash {
    display: none;
}


Featured Images

If your posts use featured images you can use them too. Here is an screenshot example from the Blogging Bootcamp #2 blog.

Sreenshot of a grid of images produced from featured images by the display posts plugin

This uses:

[display-posts category="announcement" wrapper="div" wrapper_class="ann-grid-layout" image_size="thumbnail" order="ASC"]

And this CSS:

.page-id-632 div.listing-item {
float: left;
width: 150px;
margin: 3px;
border: solid 1px #eee;
padding: 3px;
}

.page-id-632 .ann-grid-layout {
width: 500px;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

Help for Glow Blogs

Report a Glow concern
Cookie policy  Privacy policy