Post Content Shortcodes
Adds shortcodes to display the content of a post or a list of posts.
The facts
- Rating
- 4.8★ from 31
- Active installs
- 2k+
- Price
- Free
- Last updated
- 3 Apr 2018
- Added
- Aug 2011
- Requires WP
- 4.3
- Tested up to
- WP 4.9.31
- Downloads
- 100,628
Our analysis
AI-assistedPost Content Shortcodes is a WordPress plugin that allows you to display the content of a single post or a list of posts within the content area of another post. It provides two main shortcodes: [post-content] for embedding individual post content and [post-list] for generating a list of posts based on specified criteria. The plugin is designed to work with all post types by using standard WordPress functions.
This plugin is suitable for users who want to enhance their posts by including content from other posts or displaying lists of posts without needing to write custom code. It offers flexibility through various attributes to tailor the output to specific needs.
Best for: This plugin is best for WordPress users looking to integrate post content and lists into their articles.
What it does well
- ✓Allows embedding of post content within other posts
- ✓Supports displaying lists of posts with various filtering options
- ✓Compatible with all post types
Where it falls short
- •Limited information on user experience or support
- •No recent updates since April 2018
Verdict
Post Content Shortcodes offers useful functionality for displaying post content and lists, although its lack of recent updates may be a consideration for some users.
From the developer
Curtiss Grymala's own description of Post Content Shortcodes, lightly tidied.
This plugin adds two shortcodes that allow you to display either the content of a post or a list of posts within the content area of a post. This plugin should be fully compatible with all post types, as it simply uses the get_post() and get_posts() WordPress functions.
Post Content
The first shortcode is the [post-content] shortcode. Using that shortcode will allow you to display the content of one post within another post. This shortcode requires a single attribute with a key of “id”. To use this shortcode to display the content of a post or page with an ID of 25, you would use this shortcode like [post-content id=25]. This shortcode also accepts the following optional arguments:
post_name=>null– The slug of the post that you want to pull. This can be used in place of theidattributeshow_image=>false– Determines whether or not to display the featured image (if so, this appears before the content)show_excerpt=>false– Determines whether to default to showing the post excerpt instead of the post content (still falls back to post content if the excerpt is not set)excerpt_length=>0– If you would like to limit the length of the content/excerpt shown on the page, specify the maximum number of words that should be shown (a read more link will automatically be appended to any entries that exceed that limit).image_width=>0– The width, in pixels, to which the featured image should be sizedimage_height=>0– The height, in pixels, to which the featured image should be sizedshow_title=>false– Whether or not to show the post title at the top of the content. By default, the title is wrapped in<h2>tags, but you can use thepost-content-shortcodes-titlefilter to modify the title output.link_image=>false(set this to true/1 if you would like to wrap the featured image in a link to the post) – Added in 0.6view_template=>null(if you are using the Views plugin, you can set the ID of an existing Content Template to be used in-place of the default list item output) – Added in 0.6shortcodes=>false– By default, this plugin strips shortcodes out of the post content/excerpt. If you would like to attempt to process/render shortcodes in the content, set this flag to true.
Post List
The second shortcode is the [post-list] shortcode. This shortcode does not require any arguments, but will accept the following arguments (most of which are the default arguments used with get_posts()):
numberposts=>-1offset=>0category=>null(can accept category slug [with quotes] or category ID [without quotes])orderby=>titleorder=>ascinclude=>nullexclude=>nullmeta_key=>nullmeta_value=>nullpost_type=>'post'post_mime_type=>nullpost_parent=>nullpost_status=>'publish'exclude_current=>true- –blog_id => 0 (the numeric ID of the site from which to pull the posts)–
blog=>null(can be set to the numeric ID or the blog name [slug] of the site from which to pull the posts – this replaces the old blog_id attribute)show_image=>falseshow_excerpt=>falseexcerpt_length=>0image_width=>0image_height=>0tax_name=>null(the name of a taxonomy – e.g. “tag”, “category”, etc. – to be used to filter the list of posts) – Added in 0.6tax_term=>null(the list of term IDs or slugs to filter the list of posts – multiple IDs or slugs can be separated by spaces) – Added in 0.6link_image=>false(set this to true/1 if you would like to wrap the featured image in a link to the post) – Added in 0.6ignore_protected=>false(set this to true/1 if you would like the post list to exclude any password-protected posts) – Added in 0.6view_template=>null(if you are using the Views plugin, you can set the ID of an existing Content Template to be used in-place of the default list item output) – Added in 0.6
The first 13 arguments are standard arguments for the get_posts() function.
The exclude_current argument is not a standard argument for the get_posts() function. It is a custom argument for this plugin. When that argument is set to true, the current page or post will be excluded from the list of posts. If it is set to false, "false" or 0, the current page or post will be included in the post list.
The blog_id argument is also not standard. That argument allows you to pull a post from a site other than the current site when using WordPress multisite. Simply set that argument to the ID of the site from which you want to pull the post, and the post with the id you specify will be pulled from the blog/site with the blog_id you specify.
The show_image, image_width and image_height arguments only apply to the post-list shortcode. They determine whether to display the featured image and how to display it for each post within the list. If the image_width and image_height arguments are both set to 0 (which is the default), the “thumbnail” size will be used (assuming the show_image argument is set to 1 or “true”). If only one of the image_width or image_height arguments are set, the other argument will be set to 999999 to ensure that the specified dimension is met.
The show_excerpt and excerpt_length arguments also apply to the post-list shortcode. If you set show_excerpt to 1 or “true”, the post excerpt will be shown if it exists. If it doesn’t exist (or is empty), the post content will be shown (with HTML stripped out of it). You can truncate the length of the excerpts that are shown in the post list by setting the excerpt_length value. The excerpt_length is measured in words, so if you would like each excerpt to display no more than 50 words, you would set the excerpt_length parameter to 50. If you leave it set to 0 (which is the default), the entire excerpt or content will be shown in the post list. In the post-list shortcode, if show_excerpt is set to 0 or false, no content will be shown in the list (as opposed to the behavior of the show_excerpt parameter in the post-content shortcode).
The view_template argument can be a bit complicated to get working properly, and is still a bit experimental. Please use it at your own risk. Unfortunately, the standard [wpv-post-featured-image] and [wpv-post-url] shortcodes (and, by extension, the [wpv-post-link] shortcode) do not work properly, especially when trying to display content from another site in the network. There are three extra shortcodes created for use in your Content Template, the first two of which replace the [wpv-post-featured-image] and [wpv-post-url] shortcodes:
[pcs-thumbnail]– will output the post thumbnail (at the width/height you set in the post-content/post-list shortcode attributes)[pcs-post-url]– will return/output the URL to the post[pcs-entry-classes]– will add some additional classes to the entry wrapper. Accepts 2 parameters:classes– a space-separated list of the CSS classes you want to apply to the entrycolumns– a numerical value representing how many columns you want in the list (which will automatically add column-1, column-2, etc. to the list of entry classes, as well as adding a class of “first” to the first item in each row – for instance, if you have 6 items, and you use[pcs-entry-classes classes="foo bar entry" columns="3"], the class list for the first and fourth items will befoo bar entry column-1 first, the class list for the second and fifth items will befoo bar entry column-2and the class list for the third and sixth items will befoo bar entry column-3)
I have created a Gist showing a simple example of a Views Content Template used with a Post List widget.
To read more about the other arguments, please visit the codex page for the
get_posts()function.