The [post] shortcode can be used to display a secondary loop of posts anywhere using WP_Query.

Posts shortcode arguments
Typeitems grid cards
Itemscompact very compact divided relaxed very relaxed
Griddivided vertically divided celled internally celled relaxed very relaxed
Cardsraised stackable doubling centered fluid red green blue ...
queryWordPress query string or keyword (Available keywords: related).
templateCustom template name. Template file must reside in the (child) theme's templates directory and be prefixed with loop- (ex. templates/loop-list).
excerptCustom excerpt length (number of words). Set to 0 to disable excerpts. (Default: 55)
thumbnailCustom thumbnail image size (none|thumbnail|small|medium|large|full). (Default: medium)
headerPosts header size (tiny|small|medium|large|huge). (Default: small)
metaInfo displayed below post title. (date_author|timeago_author|date|timeago|author|none)
tagsSet to false to disable tags (categories, tags and sticky post indicator).
read_moreSet to false to disable the "Read more" link.
paginationSet to true to enable pagination.
pagination_alignmentPagination alignment (left|center|right).
pagination_menuAdditional classes for the pagination menu.
nextPagination next posts link text (default: "Older posts").
prevPagination previous posts link text (default: "Newer posts").
countSpecify post count when query is a keyword (default: 4).
header_textHeader text to display above posts (only displayed if there are posts).
header_classesClasses for the header.
content_beforeContent before the posts (only displayed if there are posts).
content_afterContent after the posts (only displayed if there are posts).
<posts items query="posts_per_page=3&ignore_sticky_posts=1">
<posts divided items query="posts_per_page=3&ignore_sticky_posts=1">
<posts very relaxed items query="posts_per_page=3&ignore_sticky_posts=1">
<posts grid query="posts_per_page=3&ignore_sticky_posts=1">
<posts divided two column grid query="posts_per_page=4&ignore_sticky_posts=1">
<posts celled two column grid query="posts_per_page=6&ignore_sticky_posts=1">
Internally celled grid
<posts internally celled two column grid query="posts_per_page=6&ignore_sticky_posts=1&meta_key=_thumbnail_id">
<posts cards query="posts_per_page=3&ignore_sticky_posts=1&meta_key=_thumbnail_id">
<posts four stackable cards query="posts_per_page=4&ignore_sticky_posts=1">
<posts divided items query="posts_per_page=3&ignore_sticky_posts=1" pagination="true">
<posts two column grid
	next="Older entries"
	prev="Newer entries"
	pagination_menu="tiny secondary"
Content instead of excerpt

Chap 1.23.2

Add option to display an image instead of site title in the sidebar menu (Chap Theme -> Menus -> Sidebar menu -> Branding -> Image).
Fix retrieving subtitle for Blog page (page_for_posts).
Add AMP support for horizontal dividers with text content.
Allow to save theme options with Ctrl+S hotkey.
Add option to add custom content to <head> and <body> tags (Chap Theme -> Code -> Head and body tags).
Change aria-current value in pagination active item from true to page.
Check compatibility with WooCommerce 5.7.
Chap Slides 1.0.1
Implement experimental theme option to edit slides using the block editor (Chap Theme -> Slider -> Slides post type -> Block editor).
Gutenberg Semantic UI 1.0.29
Fix gsui/list block transformation from and to core/list.
Add limit to how many times the editor checks for automatic Semantic UI recompilation.
Chap Shortcodes 1.12.8
Allow select shortcode to be clearable.
Add locale attribute to show shortcode, allowing to only show content for specific locales.
Wrap js module initialization scripts in DOMContentLoaded.
Added ability to create dynamic shortcodes which are shortcodes that can act as variables that can be used throughout the site and later modified from 1 place (Chap Theme -> Chap Shortcodes -> Dynamic shortcodes).
<posts one column vertically divided grid
	next="Older post"
	prev="Newer post"
The loop-content template is designed to show posts with content inside grid loops.
<posts items query="posts_per_page=3&ignore_sticky_posts=1" header="huge">
No thumbnails
<posts three column grid query="posts_per_page=3&ignore_sticky_posts=1&meta_key=_thumbnail_id" excerpt="20" thumbnail="none">
<posts three column grid query="posts_per_page=3&ignore_sticky_posts=1&meta_key=_thumbnail_id" excerpt="0">
No meta
<posts three column grid query="posts_per_page=3&ignore_sticky_posts=1&meta_key=_thumbnail_id" excerpt="20" meta="false">
No tags
<posts three column grid query="posts_per_page=3&ignore_sticky_posts=1&meta_key=_thumbnail_id" excerpt="20" tags="false">
<posts three column grid query="posts_per_page=3&ignore_sticky_posts=1&meta_key=_thumbnail_id" excerpt="20" read_more="false">
More posts
<subheader dividing>More posts</subheader>
<posts compact marginless items query="posts_per_page=5&ignore_sticky_posts=1" header="tiny" excerpt="0" thumbnail="none" meta="true" tags="false" read_more="false">
<posts query="related" count="5">
Using the "related" keyword as query will fetch related posts.
You can use custom WP_Query arguments programmatically by using the csc_posts_query filter. Argument 2 of that filter will contain the shortcode's arguments which can be used to identify which instance of the shortcode it is.
<posts id="custom">
add_filter('csc_posts_query', function($query, $args) {
	if(isset($args['id']) && $args['id'] === 'custom') {
		return [
			'category__in' => [2, 6],
			'posts_per_page' => 3,
	return $query;
}, 10, 2);
<posts items query="posts_per_page=3&ignore_sticky_posts=1" header_text="Header shown when there are posts" header_classes="large dividing">
<posts items query="posts_per_page=3&cat=123123" header_text="Header not shown because there are no posts">
Header can be prepended with the header_text argument for only when there are results.
<posts items query="posts_per_page=3&ignore_sticky_posts=1" content_before="{lt}div class='ui primary segment'{gt}" content_after="{lt}/div{gt}">
<posts items query="posts_per_page=3&cat=123123" content_before="{lt}div class='ui primary segment'{gt}" content_after="{lt}/div{gt}">
You can specify before and after content to wrap the posts in something. The wrapper elements won't be displayed when there are no posts.
That way there won't be an empty container when there are no related posts for example.
<posts three column internally celled stackable grid query="related" count="6" header_text="Related posts" header_classes="large dividing" content_before="{lt}div class='ui segment'{gt}" content_after="{lt}/div{gt}">
Adding this shortcode to Chap Theme -> Code -> After post content can easily display related posts for all posts.

Leave a comment

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