There are times when you want to display a list of your posts within a page.
This functionality isn’t included in WordPress. Luckily, someone has made an excellent plugin that can bring this exact functionality to your site.
In this tutorial, you’ll learn what this plugin is and how to use it to display custom lists of posts in any page on your site.
How to Use the Posts in Page Plugin
First, download the Posts in Page plugin from wordpress.org, or via the Add New page in your Plugins menu.
Once installed, you’ll find a new Posts in Page menu under Settings. This menu provides you with a series of example shortcodes you can use to display lists of posts in pages.
If you’re not familiar with WordPress shortcodes, visit our shortcodes tutorial before continuing.
For an experienced user, you may know what to do right away when you see the examples laid out on the settings page, but let’s go over five different examples of how these shortcodes can be used.
Too busy for WordPress? We can customize your site for you.
WP Site Partner is our new maintenance and customization service for busy WordPress users.
How to Show Five Specific Posts
If you wanted to show five specific posts in a page, you would format the shortcode like this:
Let’s break this down into simple pieces.
First, you’ll notice that the entire shortcode is wrapped in brackets. This is true for all shortcodes. Next, the
ic_add_posts part is always at the beginning of the Posts in Page shortcodes. This is how the plugin knows to use the shortcode. Lastly, you can see the
Each post on your site has it’s own ID number. If you’re not sure where to find it, check out this post/page ID tutorial. The “ids” parameter simply says, “Find the posts with the following IDs”. The five posts with the corresponding ID numbers would then be displayed.
Let’s do another example and this should become clearer.
How to List All Pages
You can also use this plugin to list pages like this:
You’ll notice the shortcode is the same except instead of searching for IDs, we’re searching by post type with the
By default, WordPress has two post types: posts and pages. The shortcode above tells the plugin to fetch all pages, but you could switch this to “books”, “movies”, or any other custom post type you may have on your site.
How to List All Posts in One Category
This one is very useful. You can use it to show all the posts in one category:
The example above would find all posts in the “design” category.
When adding your category, don’t use the name, use the slug. The slug is a modified version of the name that is all lowercase and uses hyphens in place of spaces. You can find the slug here in the category menu:
How to List Posts in a Category and Tag
Let’s get a bit more advanced on this one.
This shortcode is only going to get posts that are in the Cooking Tips category and are tagged as Vegetarian:
[ic_add_posts category='cooking-tips' tag='vegetarian']
The Posts in Page plugin is flexible enough to support multiple parameters like in the shortcode above. You can use this to get very specific in your selection of posts.
How to List the Latest 10 Posts (and style them)
One last example. This one is especially for Compete Themes users:
[ic_add_posts showposts='10' template='content-archive.php']
By default, the shortcode will get all the posts. The “showposts” parameter then limits the number of posts fetched to 10. Those 10 latest posts will update as you publish new posts just like the standard blog page.
Lastly, these posts will use the
content-archive.php template which is used for styling posts in all of our themes. If you’re not a Compete Themes user, you can look through the template files in your theme and find the right one needed to auto-style the posts.
With the Posts in Page plugin, you have complete control to display your posts. This allows you to create pages with one or more posts embedded in them, or design any kind of archive you want.
If you have any questions about the shortcodes or plugin used in this tutorial, drop a comment in the form below.