Ways to Display Recent Posts in WordPress

wordpress-recept-posts

3 Ways in which you could display recent posts in WordPress

Are you wondering how to show your recent posts in WordPress? Displaying the post made most recently can be of great help to users who are dealing with social media and website content. You can add recent posts to the sidebar and at the end of the post content, inside a post with a short code and in the footer widget among other areas. We will discuss how you can display these recent posts in WordPress with the help of a plug-in and widget or a short code along with the manual method for the recent posts. The present theme in the WordPress site does not allow for the recent posts to be displayed. This guide will help you add a widget to the website homepage with the help of a WordPress recent post plug-in –Recent Posts Widget Extended.

How to use the WordPress Recent Posts Widget?

WordPress comes in with an additional default widget that displays recent posts in the sidebar of your website or the widget ready area. To begin with, in the WordPress admin, visit Appearance >>Widgets and then add recent posts widget on the sidebar.

2

This built-in recent posts widget is very basic. You can start with providing an alternate title to the widget, the show date and then the number of posts that you would like to display. Next, click on Save and store the widget settings.

1. Using the Widget Extended Plug-in

The built-in widget has limited possibilities. It does not allow you to show thumbnails and excerpts which is often a priority for users. If you want to display thumbnails with vignettes from your recent posts or even want to limit these posts to specific tags and categories, you need to use an extended plug-in.

Using Recent Posts Widget Extended Plug-in

The inbuilt widget in WordPress does not have the option to show thumbnails for the recent posts. This is often a priority for most users. If you do want to display thumbnails, you need to attach a plug-in which comes in handy.

Firstly, install and activate the Recent Posts Widget plug-in. When you have done it, visit Appearance>>Widgets and add the recent posts extended widget the sidebar.

3

The extended widget has a lot of options and allows you to have full control on how the view would be to display recent WordPress posts. With this plug-in, you can show thumbnails, limit categories and tags, excerpts and also ignore controversial posts. This widget can also be used to display the recent posts and those which you would like to highlight in the site.

2. How to display the recent posts in WordPress with Short code?

If you want to add recent posts to the sidebar, you may be surprised that is very easy. With the help of short codes, you can display these recent posts in WordPress pages.

Firstly, install and then activate the Display Posts Shortcode plug-in. this works outside of the box and you do not need to configure any setting. Start with simply editing a post or even a page where you want to show your recent post. Next, use the short code with the help of parameters inside the post. The extended plug-in allows you a large pool of parameters that can be used with the short code.

Some instances:
How to display 5 recent posts with a thumbnails and an excerpt?

[display-posts posts_per_page=”5″ image_size=”thumbnail” include_excerpt=”true”]

How to show recent pages instead of posts?

[display-posts posts_per_page=”5″ post_type=”page”]

How to change the order to title instead of the date?

[display-posts posts_per_page=”5″ orderby=”title”]

How to show recent pages under a specific parent page?

[display-posts posts_per_page=”5″ post_type=”page” post_parent=”5″]

You can also use all of the above short codes inside a text widget, but you need to first add the code to the theme’s functions.php file or even a site specific plugin.

add_filter(‘widget_text’, ‘do_shortcode’);

3. How to display the recent posts manually in WordPress Theme files?

If you do not want to use either the short code method or even the extended plug-in, you have the option to use the built-in WP Query class. Using this code helps you display recent posts easily. You can use the following code:

// Define our WP Query Parameters

<?php $the_query = new WP_Query( ‘posts_per_page=5′ ); ?>

// Start our WP Query

<?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>

// Display the Post Title with Hyperlink

<li><a href=”<?php the_permalink() ?>”>

<?php the_title();?></a></li>

// Display the Post Excerpt

<li><?php the_excerpt(__(‘(more…)’)); ?></li>

// Repeat the process and reset once it hits the limit

<?php

endwhile;

wp_reset_postdata();

?>

</ul>

With the help of this code, you can see and publish 5 recent posts with their titles and excerpts in WordPress.

December 16 , 2016

Digital Aptech

This entry was posted in Word Press

Why Hire Us?

  • Awarded with "Fastest growing Indian company excellence award" at 8th International Achievers Conference at Bangkok, Thailand.
  • Featured as the "Company of the Month" in December 2016 in India's premier IT magazine, Silicon India having significant circulation in US and in India.
  • Featured among the "20 most promising Digital Marketing Solution Providers in India in 2016" in the prestigious entrepreneur magazine in India
  • ISO 9001:2008 Certified & RAR+ Recommended Company
  • Around 200+ In-house Employee and 800+ Years Of Collective Experience
  • 1500+ Digital Projects Delivered
  • Savings of up to 50% on your project cost
  • Assured monthly work production of 160 hours Guaranteed
  • Total Project Management Control
  • 9000 sq. ft. State-of-the-art Facilities & Infrastructure
  • Work with Your OWN remote team
  • 24x7 Availability when required
  • We Sign NDA for Confidentiality, All Rights Are Owned By You
  • Profitable Since Inception. US$ 2Million turnover

Projects VS DRM!

This is a Detailed Breakdown of the Advantages that the Dedicated Resource Model vis-à-vis the Conservative Project Model. Read More...

Quick Contact

Keep in touch at

Ourlocations

We are here to help you and would love to hear from you, so please feel free to contact us.


US Office

Visit Us

193 Twilight Terrace Bailey,
CO 80421
(Greater Denver Area)

Tel: +1-650 481 6031


UK Office

Visit Us

Box 4343,Office 6 Slington House,
Rankine Road, BASINGSTOKE,
RG24 8PH, United Kingdom

Tel: +44 20 79932099


India Development Office

Visit Us

EN-34 (9th Floor),
Block-EN, Sector - V,
Salt Lake City, Kolkata - 700091, West Bengal, India

Tel: +91 33 69000863 / 69


Australia Office

Visit Us

25, Ashbury Grove,
Hillside
Australia – 3037

Tel: +61 433 134 786