Ever since the Gutenberg block editor was introduced in WordPress 5.0 in December 2018, many exciting possibilities have been unleashed. One of these includes the ability to display posts from specific categories on WordPress pages.
In this post, I will share two methods to add posts from specific or all categories to your WordPress pages.
Interested in knowing how this is done? Read on.
- Display category posts on WordPress pages without a plugin
- Display category posts on WordPress pages with a plugin
Display posts from a specific category on WordPress page
You can easily add and display posts from a specific or all categories to your WordPress page in the block editor. However, if you’re using the classic editor to create content, jump to the section on adding category posts by using a plugin.
First, you should create a page in the WordPress admin area. We will use one of the widgets blocks to add the posts.
Once you have created the page, add a new block by clicking on the + circle. Scroll to the Widgets drop-down and click on the Latest Posts block to insert it into the page.
By default, it displays the 5 latest posts from all categories on your WordPress blog, but you can customize almost everything. Let us see how this done.
In the Block settings on the right, you have multiple options to play around with. If you wish to display posts from specific categories, jump to the Sorting and Filtering menu, and select your desired category from the drop-down.
Also Read: Comprehensive Review of Astra WordPress Theme.
You now see the posts from that selected category only. But that’s not all.
You can also decide the number of posts you want to display from that category and also sort the posts from oldest to newest or vice-versa. You can choose between List view and Grid view to show the posts on the page.
What other options are available here? You can toggle the Post Content Settings to show the post title or the excerpt and also display the post date by toggling the Post Meta Settings.
If you wish to display posts from multiple categories on a WordPress page, you can duplicate the block and then select a different post category.
Wasn’t that nice and simple? But what if you’re using the classic editor to create your page? I have you covered.
Display posts on a WordPress page with a plugin
You can add and display posts on WordPress pages using the Posts in Page plugin. This plugin works by inserting shortcodes in pages so you can also use it to insert posts using the Gutenberg block editor.
Once you have installed and activated the plugin, you can check out the shortcodes available for use on your page by navigating to the plugin settings in your admin dashboard.
If you wish to insert all posts on the page, you can use the shortcode [ic_add_posts]. But if you wish to add posts only from selected categories, you should use the shortcode [ic_add_posts category=’category-slug’].
What’s more, you can even include posts from specific tags, insert Read more link, and do much more with this plugin.
You just saw 2 methods to display posts from specific categories on your WordPress page using the block and classic editors. Did you find this WordPress tutorial easy to follow, and could you add category posts to your pages? Let me know in the comments below.