WPBeginner

Beginner's Guide for WordPress

  • Blog
    • Beginners Guide
    • News
    • Opinion
    • Showcase
    • Themes
    • Tutorials
    • WordPress Plugins
  • Start Here
    • How to Start a Blog
    • Create a Website
    • Start an Online Store
    • Best Website Builder
    • Email Marketing
    • WordPress Hosting
    • Business Name Ideas
  • Deals
    • Bluehost Coupon
    • SiteGround Coupon
    • WP Engine Coupon
    • HostGator Coupon
    • Domain.com Coupon
    • Constant Contact
    • View All Deals »
  • Glossary
  • Videos
  • Products
X
☰
Beginner's Guide for WordPress / Start your WordPress Blog in minutes
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

WPBeginner» Blog» Tutorials» How to Display Recent Posts in WordPress

How to Display Recent Posts in WordPress

Last updated on April 23rd, 2020 by Editorial Staff
542 Shares
Share
Tweet
Share
Pin
Free WordPress Video Tutorials on YouTube by WPBeginner
How to Display Recent Posts in WordPress

Do you want to show your recent posts in WordPress? Displaying recent posts help users easily discover your new content and spend more time on your site.

You can add a list of your latest posts in your sidebar, after the end of your post content, inside your post content with a shortcode, in your footer widget area, or anywhere else you like.

In this article, we will show you how to display recent posts in WordPress using a variety of different methods

Displaying recent posts in WordPress

Why Add Recent Posts in WordPress?

If you have been running a WordPress blog or website for a long time, then you may have some older articles getting regular traffic from search engines and other sources.

Many of these users will check out the information they were looking for and leave. More than 75% of those visitors will never see your website again.

To keep users coming back to your website, you need to ensure that they spend more time on your website.

One way to do this is by showing them other recent posts that they should see. This helps users uncover more content on your website which leads to them spending more time on your website.

As users view more pages, this gives you time to convince them into signing up for your email newsletter or making a purchase.

That being said, let’s take a look at how to easily display recent posts in WordPress using multiple methods. Click on the quick links to jump straight to that method:

  • Use WordPress’s Latest Posts Gutenberg Block
  • Use the WordPress Recent Posts Widget
  • Use the Recent Posts Widget With Thumbnails Plugin
  • Display Recent Posts Using a Shortcode
  • Display Recent Posts Manually in WordPress

Video Tutorial

Subscribe to WPBeginner

If you’d prefer written instructions, just keep reading.

Method 1. Use WordPress’s Latest Posts Gutenberg Block

The WordPress block (Gutenberg) editor has a built-in block for displaying your latest posts. You can easily add this to any of the posts or pages on your site.

To use this block, simply edit the post where you to display recent posts. On the post edit screen, you need to add the ‘Latest Posts’ block to the content area.

Adding the Latest Posts block to a page

There are lots of different ways you can configure this block. By default, it just shows the post titles, but you can easily customize it.

For example, you can toggle the post content on and off in the right-hand pane. This lets you choose to add post content or excerpt next to the title.

You can also customize excerpt length which defaults to 55 words, but you can pick any value between 10 and 100 words.

Configuring how the post excerpt should display

If you want, you can display the post date. This will appear just below the title.

Displaying the dates of your latest posts

You can also choose exactly how your posts will display. You can order them differently from the default ‘Newest to Oldest’, and you can show only the latest posts from a specific category.

From the settings panel, you can also choose how many posts will display. By default, the block shows 5 posts, but you can display anywhere between 1 and 100 posts.

Sorting and filtering the list of latest posts

You also have the option to display your recent posts in a column grid rather than a list.

Setting the latest posts to display in a grid format

You can customize the grid to featured images for your posts, resize the image, and align them accordingly:

Adding the featured images to your recent posts block

Here’s how the finished block looks live on the website:

Latest posts block displaying live

Method 2. Use the WordPress Recent Posts Widget

What if you want to show a list of your latest posts in your sidebar instead of on a page? WordPress comes with a built-in default widget to display recent posts in your site’s sidebar or any widget ready area.

In your WordPress dashboard, go to Appearance » Widgets and add the ‘Recent Posts’ widget to your sidebar.

Recent posts widget

The built-in Recent Posts widget doesn’t offer many options. You can give the widget a title, choose whether or not to show the dates of posts, and add the number of posts you want to display.

Once you’re done, click on the ‘Save’ button to store your widget settings.

Here’s the widget live on the blog, with the title ‘New Posts’ and dates enabled:

The recent posts displaying in the sidebar on the blog

Method 3. Use the Recent Posts Widget With Thumbnails Plugin

The built-in widget we mentioned above is quite limited.

What if you want to display thumbnails and excerpts with your recent posts? What if you’d like to only show posts from a specific category in your sidebar?

Well, that’s when the Recent Posts Widget With Thumbnails plugin comes in handy. It does a lot more than just thumbnails, and it’s free.

First, you’ll need to install and activate the WordPress Recent Posts Widget With Thumbnails plugin.

Next, go to Appearance » Widgets page where you should see the ‘Recent Posts With Thumbnails’ widget.

The Recent Posts With Thumbnails widget in the list of available widgets

You need to add it to your sidebar or another widget-enabled area.

The Recent Posts With Thumbnails widget in the sidebar

The Recent Posts With Thumbnails widget comes with a lot of options. It gives you full control on how you want to display recent posts on your WordPress site.

You can also show excerpts, show posts from specific categories, ignore sticky posts, display random posts, and more.

Once you are done, don’t forget to click on the save button to store your settings. You can now visit your website to see your recent posts with thumbnails.

Display Recent Posts in Sidebar

Method 4. Display Recent Posts Using a Shortcode

Using the ‘Latest Posts’ block is definitely the easiest way to display recent posts in WordPress posts and pages. However, if you chose to disable Gutenberg and keep the Classic editor, you can use shortcodes instead.

First, install and activate the Display Posts plugin. It works out of the box, and there are no settings for you to configure.

Simply edit a post or page where you want to display your recent posts. Next, use the shortcode [display-posts]. The plugin offers a whole range of parameters that you can use with the shortcode.

Here are some examples of what you can do using this plugin.

Display 3 recent posts with thumbnails and excerpt:

[display-posts posts_per_page="3" image_size="thumbnail" include_excerpt="true"]

Display recent pages instead of posts:

[display-posts posts_per_page="3" post_type="page"]

Change the order to title instead of date:

[display-posts posts_per_page="3" orderby="title"]

Display recent pages under a specific parent page:

[display-posts posts_per_page="3" post_type="page" post_parent="5"]

You can also include additional styling. For instance, you may want to align your featured images to the left. You can do that using the instructions on the plugin’s website here.

Here’s how our list of recent posts looked, using those instructions:

Displaying recent posts using the shortcode widget

For a full list of parameters visit the plugin’s documentation.

You can also use these shortcodes inside a text widget. First, you will need to enable shortcodes in your text widgets by adding this code to your theme’s functions.php file or a site specific plugin.

add_filter('widget_text', 'do_shortcode');

Method 5. Display Recent Posts Manually in WordPress

More advanced WordPress users may want to add recent posts directly in their WordPress theme files. Of course, you should use a child theme for this so that when you update your theme, you don’t lose your changes.

It’s always a good idea to create a backup before you edit your theme files. If anything does go wrong, you might want to take a look at our list of the most common WordPress errors and how to fix them.

The easiest way to manually display recent posts to use the built-in WP_Query class. Simply add this code where you want to display the recent posts.

<ul>

<?php 
// Define our WP Query Parameters
$the_query = new WP_Query( 'posts_per_page=5' ); ?>
 

<?php 
// Start our WP Query
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>
 

<li><?php 
// Display the Post Excerpt
the_excerpt(__('(more…)')); ?></li>
 

<?php 
// Repeat the process and reset once it hits the limit
endwhile;
wp_reset_postdata();
?>
</ul>

This code displays the five most recent posts with their title and excerpt. The WP_Query class has tons of parameters that allow you to customize it any way that you like. For more information please refer to the WordPress developer documentation.

We hope that this article helped you learn how to display recent posts in WordPress. You might also be interested in our article on how to create a separate page for blog posts in WordPress, and our comparison of the best drag and drop WordPress page builder plugins.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

542 Shares
Share
Tweet
Share
Pin
Popular on WPBeginner Right Now!
  • Google Analytics in WordPress

    How to Install Google Analytics in WordPress for Beginners

  • How to Start Your Own Podcast (Step by Step)

    How to Start Your Own Podcast (Step by Step)

  • How to Fix the Error Establishing a Database Connection in WordPress

    How to Fix the Error Establishing a Database Connection in WordPress

  • Revealed: Why Building an Email List is so Important Today (6 Reasons)

    Revealed: Why Building an Email List is so Important Today (6 Reasons)

About the Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Trusted by over 1.3 million readers worldwide.

The Ultimate WordPress Toolkit

128 Comments

Leave a Reply
  1. Sean says:
    Oct 12, 2020 at 12:09 pm

    I’m using ‘Display Posts’ and love it. I run a gardening website so if a post is called ‘How to Grow Beetroot’, is there any way by using Display Posts that the only part of the title that is displayed is ‘Beetroot’?

    Thank you

    Reply
    • WPBeginner Support says:
      Oct 13, 2020 at 9:01 am

      The plugin by default does not change your post titles. You would want to reach out to the plugin’s support if you wanted that functionality

      Reply
  2. Lucy says:
    Oct 4, 2020 at 2:45 am

    I can’t seem to get the Read More to appear in the published version. It appears in the editor but when I publish, it is gone. I’m using Astra theme.

    Reply
    • WPBeginner Support says:
      Oct 5, 2020 at 11:29 am

      You would want to check for if you need to enable excerpts with your specific theme for it to display how you are wanting.

      Reply
  3. Hamza says:
    Jul 25, 2020 at 11:20 am

    Hi, When I click on the “Read more..” on a post on Recent Posts, it does not to go to that specific post page rather it loads the home page.

    Appreciate if you can help on this.

    Thanks

    Reply
    • WPBeginner Support says:
      Jul 27, 2020 at 1:18 pm

      It would depend on what method you are using for possible issues and solutions.

      Reply
  4. Julian says:
    Jun 11, 2020 at 9:09 am

    This was really helpful thanks. Just a correction to note, in the last code snippet the comments are using // but they’re not actually in the php so they will show up if you use this code as-is.

    Reply
    • WPBeginner Support says:
      Jun 12, 2020 at 8:53 am

      Thank you for pointing that out, we’ll update the code to fix this :)

      Reply
  5. Michael Robinson says:
    May 17, 2020 at 10:33 am

    Hi, I”m still lost. My posts still don’t show up on my homepage, I have content blocks set up on my homepage and using Guterberg to set up the content. When I publish the post. It does not show up on my Homepage feature posts grid. There is something I am not getting.

    Reply
    • WPBeginner Support says:
      May 19, 2020 at 9:15 am

      You may want to clear any caching on your site to ensure your caching is not preventing the changes from being seen.

      Reply
  6. Venkat says:
    Apr 8, 2020 at 11:16 am

    My blog shows bulleted post, how do I stop it from being an unordered list, and make it in grid?

    Reply
    • WPBeginner Support says:
      Apr 9, 2020 at 9:11 am

      You can use the new latest post block and use the built-in grid option in the block’s options

      Reply
  7. Mohammed says:
    Apr 5, 2020 at 11:17 pm

    Hello Friends,

    My query is what is the short code to display all the content of a post?!

    Reply
    • WPBeginner Support says:
      Apr 6, 2020 at 2:44 pm

      It would depend on why you want to do that. If you want the entire content of a post to be visible to a user it would normally be best to link to the post you want to show so your users can read from the source.

      Reply
  8. Miracle Lawrence says:
    Feb 11, 2020 at 10:19 am

    My blog shows bulleted post, how do I stop it from being an unordered list, and make it in grid?

    Reply
    • WPBeginner Support says:
      Feb 12, 2020 at 8:26 am

      For making your posts appear in a grid, you would want to take a look at our article here:
      https://www.wpbeginner.com/plugins/how-to-display-your-wordpress-posts-in-a-grid-layout/

      Reply
  9. Sarah says:
    Jan 18, 2020 at 10:45 pm

    Hello – I am trying to figure out why the Recent Posts widget (the basic one) is excluding my most recent post. I would like that to show. Is there custom CSS I could add to make it show? or can I edit the code?

    Reply
    • WPBeginner Support says:
      Jan 21, 2020 at 1:17 pm

      The most common reason for something like that would be if you have caching or similar on your site that is preventing the widget from updating, you would first want to clear your cache. We have an article on how you’re able to do so here:
      https://www.wpbeginner.com/beginners-guide/how-to-clear-your-cache-in-wordpress/

      Reply
  10. WPBeginner Support says:
    Nov 19, 2019 at 9:52 am

    It would depend on how you want it styled but you could create a tabber widget for what I believe you’re wanting:

    https://www.wpbeginner.com/wp-tutorials/how-to-add-jquery-tabber-widget-in-wordpress/

    Reply
  11. Ata says:
    Nov 18, 2019 at 10:24 pm

    Thank you for the useful post.
    I have a question. What if I want to display recent posts on front page categories wise. Like recent posts should appear on the front page under a particular category.
    Is it possible?

    Reply
  12. Arif says:
    Jun 14, 2019 at 9:29 pm

    Awesome as always. When I found wpbeginner is sharing on this topic I was like . But my question is placing post widget on homepage is beneficial or it’s just easy to navigate? Can it help with seo perspective? Can it help with the ranking? Your response highly appreciated

    Reply
    • WPBeginner Support says:
      Jun 17, 2019 at 11:21 am

      Making your site easier to navigate can improve your SEO as well as making it easier for your users to continue navigating through your site.

      Reply
  13. Rajiv Dave says:
    Jun 4, 2019 at 1:20 pm

    Thanks for recent post articles. I was trying so much but now its so easy to work just adding adding it. Thanks for sharing

    Reply
    • WPBeginner Support says:
      Jun 5, 2019 at 10:13 am

      Glad our article was helpful :)

      Reply
  14. aditya tomar says:
    Apr 13, 2019 at 4:13 pm

    thank you so much. this helped me a lot. thank you thank you :) :).

    Reply
    • WPBeginner Support says:
      Apr 15, 2019 at 12:13 pm

      You’re welcome :)

      Reply
  15. Trang says:
    Jan 15, 2019 at 4:07 am

    When I tried to edit the page that’s supposed to display blog posts, the editor disappears wit this notice: “You are currently editing the page that shows your latest posts”. Does anyone have this same problem as me?

    Reply
    • WPBeginner Support says:
      Jan 15, 2019 at 2:38 pm

      The Blog page is automatically generated by your theme so you will not have the option to edit it directly unless you have a theme specific setting to edit it.

      Reply
  16. Nikos Tzortzis says:
    Jul 25, 2017 at 6:40 am

    HI…..i just started using WP and i need some help! i want to publish articles from 3 different categories to 3 different pages.how can i make a page point to an article category?

    Reply
  17. Rob says:
    Jun 12, 2017 at 11:10 am

    Is there a way to customize the way post titles are displayed? I don’t want to display the full title of the post or page, just the keywords… much like you shorten the slug for your url. Actually this is exactly what I’m looking for, to display the slug as a link, and not the entire page title. Ideas?

    Reply
  18. Bryan Free says:
    Apr 27, 2017 at 3:16 pm

    Great article, When I use the Recent post widget and set it to only display a category my sticky posts do not work. Have you encountered this before or know of a solution?

    Reply
  19. eyllan8547 says:
    Mar 16, 2017 at 8:26 am

    Hi, thanks for this complete article.

    I have a doubt, if I have my wordpress integrated with Magento, can I use magento within the short code to put the last entries in my magento house?

    Reply
  20. Mankirat Deep Kaur says:
    Mar 16, 2017 at 3:19 am

    The short code to display recent posts with thumbnails does not work… only shows the posts title not the thumbnails… how to fix this.??? please reply…:(

    Reply
  21. Kevin says:
    Feb 8, 2017 at 6:09 pm

    Hi,

    I am intending on adding the latest posts on my homepage, but I want a different section for the latest post to display on it’s own;

    and another section under this designed differently for the latest posts that range from 2-5. (The 2nd, 3rd, 4th and 5th post).

    What is the shortcode php for this to add to my theme template.

    Many thanks.

    Reply
  22. James Gielow says:
    Feb 7, 2017 at 1:11 pm

    Hello,

    I have post shortcode on my page:

    I’ve tweaked it a little bit as follows:

    [display-posts posts_per_page=”100″ include_excerpt=”false” image_size=”large” wrapper=”div” orderby=”comment_count”]

    I’m noticing that the spacing in between the posts is cutting off the titles and it makes the page look sloppy. What code can I add to add a little space after each post preview?

    thanks in advance!
    James

    Reply
    • WPBeginner Support says:
      Feb 7, 2017 at 9:28 pm

      Hi James,

      You can adjust spacing between posts using CSS.

      Reply
  23. Paul says:
    Jan 26, 2017 at 8:45 pm

    Thanks! I was struggling with adding recent posts to a page. Your guide saved me a lot of time :)

    Reply
  24. Erpel says:
    Dec 22, 2016 at 12:31 pm

    Thank you for this tutorial!

    Reply
    • WPBeginner Support says:
      Dec 22, 2016 at 3:03 pm

      You are welcome :)

      Reply
  25. Adam says:
    Dec 13, 2016 at 4:25 pm

    Love the idea, the only thing I don’t like is the display.

    So it’s great how it has the thumbnail, title, excerpt, etc but the way the title and excerpt are positioned…I think they should be inline with the thumbnail, not at the bottom of it…it looks awkward and unappealing…any way to make it inline?

    Reply
  26. Kenneth says:
    Nov 23, 2016 at 8:40 am

    Please help me with this
    How to display recently post in a post on phone version?
    Reply please… Thanks

    Reply
  27. sai says:
    Nov 12, 2016 at 8:42 am

    If I am using 2 database. 1 for main site and 2nd for blog then how to add recent post on home page ?

    Reply
  28. djafa says:
    Oct 11, 2016 at 2:21 am

    Hi, I put [display-posts posts_per_page=”5″ post_type=”page”] on my post, but not working, can you help how to find the problem?

    Reply
  29. Kev says:
    Sep 29, 2016 at 1:06 pm

    Great writeup. I want to display the recent post on a page. awahere am I suppose to paste the code?

    Reply
  30. Clark Keng says:
    Sep 26, 2016 at 10:28 pm

    this article can help me thank you : )

    Reply
  31. Id abdou says:
    Sep 25, 2016 at 2:49 pm

    gereat … thanks a lot .

    Reply
  32. PARAM says:
    Jul 8, 2016 at 3:37 am

    How to show thumbnail of 1st post bigger and others smaller…..

    Reply
    • Brad says:
      Oct 8, 2016 at 9:21 am

      You could perhaps use :first-child CSS to do this.

      Reply
  33. Louise says:
    Apr 9, 2016 at 10:13 pm

    Hi,
    Thank you for this post. Really helped a lot.
    But then I have a problem. When I click on one of the recent posts – it directed me to the static page and not the post itself. Kindly help me resolved this issue. Thank you.

    Reply
    • WPBeginner Support says:
      Apr 11, 2016 at 4:05 pm

      Try updating your permalink structure. Simply visit Settings » Permalinks and then click on the save changes button without changing anything.

      Reply
  34. Ellen Allard (Gluten Free Diva) says:
    Mar 5, 2016 at 12:10 pm

    So glad to have found you!

    I’m confused – I can’t seem to get my most recent blog post to appear on my blog page. Can you advise please? Thank you so much!

    best, Ellen Allard, Gluten Free Diva

    Reply
  35. Tim Zeman says:
    Mar 3, 2016 at 4:41 pm

    So I was able to get the 5 latest post to show in the right sidebar but when I click on a post to read it I get the following error on Home Page Oops something went wrong

    How do I get the selected post to display?

    Reply
  36. John Mason says:
    Mar 1, 2016 at 9:55 am

    Are links to the recent posts widget dofollow links?

    Reply
  37. Val Archer says:
    Jan 29, 2016 at 8:34 am

    Hi – thanks million for this manual method, very grateful. Please can you tell me how to add a thumbnail image to it? I’m referring to the method starting:

    // Define our WP Query Parameters

    Reply
    • Rajkumar says:
      Jun 20, 2016 at 4:26 am

      hello,
      To display a thumbnail image u can ues

      Reply
    • Andrew Wilkerson says:
      Mar 2, 2018 at 12:45 am

      Hi Val, Hope your doing well, I was just scrolling through this article and saw your name and thought straight away I know that name! It’s a small world.
      I made one of your sprouters in the late 90’s I think it would have been.
      Funny thing is I was just thinking about building another one a few days ago!

      Crazy how things happen sometimes!
      Weird that I then just stumbled across your comment on here today in 2018 while I’m working on my website for something totally unrelated.

      I remember I really enjoyed reading about your life and the move to Sth Africa, your cures for tooth aces etc. I’ll have to have another look into it all again soon when I have time, anyway just thought I’d say Hi.

      Reply
  38. Farhad says:
    Jan 27, 2016 at 4:27 am

    Hello, I used the same shortcut in my site but it not show my recent posts at all, what is the probelm?

    Reply
    • WPBeginner Support says:
      Jan 28, 2016 at 9:47 am

      This article shows several ways to display recent posts, which one you tried on your website?

      Reply
  39. Marcio says:
    Jan 26, 2016 at 11:55 am

    Hey, how to display recent posts from another wordpress site?

    Reply
    • WPBeginner Support says:
      Jan 26, 2016 at 5:39 pm

      You can fetch them using RSS feed. Please see, how to fetch feeds in WordPress.

      Reply
  40. Joe says:
    Jan 20, 2016 at 9:40 pm

    Hi,

    On my recent posts on the sidebar, when I click a specific post it brings me to the latest post and then displays everything. How do I get it so that when I click a specific post it only shows that post?

    Thanks!

    Reply
  41. Sally says:
    Jan 5, 2016 at 2:00 pm

    Is there a code I can add to activate pagination using the Recent Posts Extended widget?

    Currently I have my home page widgetized so I’m using the widget.

    Thanks!

    Reply
  42. alin dragoescu says:
    Dec 18, 2015 at 7:55 am

    Hello,

    Please let me know if it’s posible to show the post list in dropdown?

    Reply
  43. Nick NEvsky says:
    Oct 18, 2015 at 6:38 pm

    Hi! Great plugin, thank you!
    Is it possible to have the author listed, instead of the post name?
    Thanks!

    Reply
  44. Jason says:
    Jun 30, 2015 at 4:02 am

    The version I downloaded does not include the ability to display thumbnails…cant see the option anywhere. I am using version 0.9.9

    Any clues?

    Reply
  45. andrea says:
    Feb 11, 2015 at 10:46 am

    Hi, my issue is to display the latest post full content in a static home page… and i was thinking that the last snippet was what i needed… but unfortunately it does not works properly. In effects it shows title but not the content. could u help me please

    Reply
  46. Tushar says:
    Jan 16, 2015 at 3:25 am

    Hi I am new on wordpress, I want to show Client Testimonial using post….How should I do it..? any suggestions please ?

    Reply
  47. WPBeginner Staff says:
    Jan 11, 2015 at 2:56 pm

    Here is an easier way. Install Display Posts Shortcode plugin. Create a blank page and add the shortcode as described in plugins documentation. Publish the page. Go to Settings > Reading and select the page you just created as your static page. Redit the static page and add the slider just before the display posts shortcode. Hope this helps you.

    Reply
    • philip says:
      Dec 6, 2015 at 6:14 pm

      please how do decrease the number of words showed before the read more link i.e decrease the excerpt

      Reply
      • WPBeginner Support says:
        Dec 7, 2015 at 3:13 am

        Please see our guide on How to customize WordPress excerpts (no coding required).

        Reply
  48. Emily says:
    Jan 10, 2015 at 12:20 am

    Hi, I am wanting to add a slider to the top of my homepage, but it will only allow me to do so if I use a static page. Right now when you go directly to my website, it is my latest posts in full length. If I change my homepage to a static page so that I can include the slider, will this work to add the recent posts below, just as it appears now? Where would I be posting this code? Into the static homepage?

    Note– I recently tried messing with my php and broke my code and had some major issues.. so I’m pretty nervous messing with php.

    Reply
  49. Subrata says:
    Oct 6, 2014 at 2:20 am

    hi!…can anyone tell me how to display top rated blog posts (only 5) in increasing order (numeric order) by using PHP codes?

    Reply
  50. Oliver says:
    Sep 3, 2014 at 6:38 am

    Hi there. I am a designer so I’ve never been good at PHP. At least I can read and change it for my conditions most of the time. This time I’d like to call for the nine latest posts excluding the very last one inside my slideshow container.

    For now I just set the first post on display none. This works fine; however the slideshow still counts to ten. That’s why you find the last page empty.
    Is there any way to exclude the very last post when calling for recent posts? Thank you so much in advance!

    Reply
« 1 2

Leave a Reply Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

Over 1,320,000+ Readers

Get fresh content from WPBeginner

Featured WordPress Plugin
PushEngage
PushEngage
Increase your website traffic & revenue with push notifications. Learn More »
How to Start a Blog How to Start a Blog
I need help with ...
Starting a
Blog
WordPress
Performance
WordPress
Security
WordPress
SEO
WordPress
Errors
Building an
Online Store
Useful WordPress Guides
    • 7 Best WordPress Backup Plugins Compared (Pros and Cons)
    • How to Fix the Error Establishing a Database Connection in WordPress
    • Why You Need a CDN for your WordPress Blog? [Infographic]
    • 30 Legit Ways to Make Money Online Blogging with WordPress
    • Self Hosted WordPress.org vs. Free WordPress.com [Infograph]
    • Free Recording: WordPress Workshop for Beginners
    • 24 Must Have WordPress Plugins for Business Websites
    • How to Properly Move Your Blog from WordPress.com to WordPress.org
    • 5 Best Contact Form Plugins for WordPress Compared
    • Which is the Best WordPress Popup Plugin? (Comparison)
    • Best WooCommerce Hosting in 2021 (Comparison)
    • How to Fix the Internal Server Error in WordPress
    • How to Install WordPress - Complete WordPress Installation Tutorial
    • Why You Should Start Building an Email List Right Away
    • How to Properly Move WordPress to a New Domain Without Losing SEO
    • How to Choose the Best WordPress Hosting for Your Website
    • How to Choose the Best Blogging Platform (Comparison)
    • WordPress Tutorials - 200+ Step by Step WordPress Tutorials
    • 5 Best WordPress Ecommerce Plugins Compared
    • 5 Best WordPress Membership Plugins (Compared)
    • 7 Best Email Marketing Services for Small Business (2021)
    • How to Choose the Best Domain Registrar (Compared)
    • The Truth About Shared WordPress Web Hosting
    • When Do You Really Need Managed WordPress Hosting?
    • 5 Best Drag and Drop WordPress Page Builders Compared
    • How to Switch from Blogger to WordPress without Losing Google Rankings
    • How to Properly Switch From Wix to WordPress (Step by Step)
    • How to Properly Move from Weebly to WordPress (Step by Step)
    • Do You Really Need a VPS? Best WordPress VPS Hosting Compared
    • How to Properly Move from Squarespace to WordPress
    • How to Register a Domain Name (+ tip to get it for FREE)
    • HostGator Review - An Honest Look at Speed & Uptime (2021)
    • SiteGround Reviews from 4464 Users & Our Experts (2021)
    • Bluehost Review from Real Users + Performance Stats (2021)
    • How Much Does It Really Cost to Build a WordPress Website?
    • How to Create an Email Newsletter the RIGHT WAY (Step by Step)
    • Free Business Name Generator (A.I Powered)
    • How to Create a Free Business Email Address in 5 Minutes (Step by Step)
    • How to Install Google Analytics in WordPress for Beginners
    • How to Move WordPress to a New Host or Server With No Downtime
    • Why is WordPress Free? What are the Costs? What is the Catch?
    • How to Make a Website in 2021 – Step by Step Guide
Deals & Coupons (view all)
MainWP
MainWP Coupon
Get 15% OFF on MainWP WordPress multisite manager plugin.
Drip Coupon Code
Drip Coupon
Get an exclusive 14-day FREE trial of this powerful marketing automation tool.
Featured In
About WPBeginner®

WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress resources that allows WordPress beginners to improve their site(s).

Join our team: We are Hiring!

Site Links
  • About Us
  • Contact Us
  • FTC Disclosure
  • Privacy Policy
  • Terms of Service
  • Free Blog Setup
  • Free Business Tools
  • Growth Fund
Our Sites
  • OptinMonster
  • MonsterInsights
  • WPForms
  • SeedProd
  • Nameboy
  • RafflePress
  • Smash Balloon
  • AIOSEO

Copyright © 2009 - 2021 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.

Managed by Awesome Motive | WordPress hosting by SiteGround | WordPress Security by Sucuri.