Skip to Main Content

How to display recent articles in a specific category

Divi: the easiest WordPress theme to use

Easily create your website with Elementor

Elementor allows you to easily create any website design with a professional look. Stop paying expensive for what you can do yourself. [Free]

Would you like to view recent posts from a specific category on WordPress?

The default Recent Posts widget displays posts from all categories and there is no option to filter them by category.

In this article, we'll show you how to easily view recent posts from a specific category in WordPress.

But before, if you have never installed WordPress discover How to Install a WordPress Blog in 7 Steps et How to search, install and activate a WordPress theme on your blog 

Then back to why we are here.

view recent posts from a specific category on WordPress

Filtering articles by category on WordPress

If you just want to create a page to display recent posts for a particular category, your WordPress website already has separate pages for each category.

Discover by the way How to allow users to filter articles and pages

You can add links to all pages in your category by visiting the page " Appearance> Widgets And adding the Categories widget to your sidebar. You can also add categories to your navigation menus. 

Check out this article to give style to your navigation menus

On the other hand, if you want to display recent posts from a specific category on your sidebar, there is no default widget for that. The default Recent Posts widget does not allow you to filter posts by category or tag.

Fortunately, there is another way. Let's look at how to easily display recent posts in a specific category on WordPress.

Method 1. Display recent articles of a category using a plugin

This method is easier, and is recommended for most users.

The first thing you need to do is to install and activate the plugin Extended Widget Posts Widget. For more details, check out our step by step guide on how to install a WordPress plugin.

After activating the plugin, you must visit the page " Appearance> Widgets »And add the widget« Recent Posts Extended To your sidebar.

Add a recent posts extended widget on wordpressThe widget menu will expand to show settings. You must select the category or categories that you want to display under the option "Limit to Category».

Divi: The best WordPress theme of all time!

With over 901.000 downloads, Divi is the most popular WordPress theme in the world. It is complete, easy to use and comes with more than 62 free templates. [Recommended]

Try our 5 premium WordPress plugins to optimize your categories

The widget has a lot of options that you can customize. You can view the post thumbnail, date, relative date, summary or snippets, and more.

Do not forget to click on the button « Save To save the settings of your widget.

You can now visit your website to see recent articles posted by category.

How to display recent articles by category using a Shortcode

The widget Extended Posts Extended »Also allows you to use a shortcode to display recent posts on your website, including other pages.

Discover How to add categories to the menu of your WordPress blog

You will need to change the post or page for which you want to view recent posts in a specific category. In the post editor, you need to add the following shortcode:

[Rpwe limit = "5" excerpt = "true" cat = "72"]

This shortcode displays 5 recent articles of a specific category with the post snippet. You must replace the value of the parameter " cat With the ID of the category you want to display.

Consult our tutorial on how to find the category id in WordPress.

After adding the shortcode, you can save your publication or page to validate your changes.

2 method. View recent articles in a category using a code

This method requires you to add code to your WordPress theme files. If you haven't already, check out our guide on how to copy and paste code in WordPress.

You need to add the following code in your WordPress theme files where you want to display recent posts of a specific category.

have_posts ()): $ catquery-> the_post (); ?>

The first line of this code creates a new WordPress query with a specific category ID. You must replace it with your category ID. It will only display the title of the publication in a list.

You can change it to display the full content by adding the following code:

have_posts ()): $ catquery-> the_post (); ?> 

You can also replace the " the_content With " the_excerpt To display excerpts from the article instead of the full article.

Discover also some premium WordPress plugins  

You can use other WordPress plugins to give a modern look and optimize the grip of your blog or website.

We offer you here some premium WordPress plugins that will help you do that.

1. WooCommerce Page Builder

WooCommerce Page Builder is a very popular premium WordPress plugin which offers a fairly consistent number of shortcodes and which allows you to create several types of personalized pages (product, cart, checkout, "my Account") on your WooCommerce website.

WooCommerce-page-builder

It is a premium extension of the Visual Composer plugin that you must install beforehand. Thanks to this plugin, you will have the possibility to create unique e-Commerce websites using any WordPress theme, and save you a lot of money.

Download | Demo | Web hosting

2. Testimonial Showcase

Testimonial Showcase is a premium WordPress plugin that allows you to display testimonials, reviews, or other quotes in multiple ways. 

Testimonials showcase for visual composer plugin

It is fully compatible with the latest version of WordPress and Visual Composer. It comes with 5 templates for integrated layouts, perfect for displaying your testimonials.

Read also our article on 5 WordPress plugins to create subscription forms

You will be able to display your testimonials in the form of grid or slider. It is fully customizable and supports the star rating system. You will also be able to allow your users to submit their testimonials on the frontend of your website.

Download | Demo | Web hosting

3. RoyalSlider

The most downloaded slider on CodeCanyon, Royal Slider comes loaded with irresistible features. Used by companies as diverse as Coca-Cola, Ralph Lauren, and Land Rover, this premium WordPress plugin does just about everything you might expect from a slider. 

Royalslider touch content slider for wordpress

The most attractive feature is the native full screen support and its layout perfect for displaying high resolution photographs. This plugin will definitely impress your visitors with its professional features.

Discover our 5 WordPress plugins to add geolocation to a Blog

As features we will have among others: the ability to create several sliders with different styles per page, support for tactile navigation, responsive design, vertical or horizontal thumbnails, bullets or tabs for navigation, and more.

Download | Demo | Web hosting

Easily create your Online Store

Download free WooCommerce, the best e-commerce plugins to sell your physical and digital products on WordPress. [Recommended]

Recommended Resources

Find out about other recommended resources to help you build and manage your website.

Conclusion

Here! That's all. We hope that it will allow you to easily display recent articles in a category on WordPress. Feel free to share this tutorial with your friends on your favorite social networks

However, you will also be able to consult our resources, if you need more elements to carry out your projects of creation of Internet sites, by consulting our guide on the WordPress blog creation.

If you have suggestions or remarks, leave them in our section Comments.

... 

This article features 0 comments

Leave a comment

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

This site uses Akismet to reduce unwanted. Learn more about how your comments data is used.

Back To Top
11 shares
Share4
tweet1
Save6