Add recent posts to articles (with and without plugins)

Friends, please help. On the site we use the lite version of Astra theme.

Task: add recent posts to articles. Now they are displayed simply, as the next and previous.

I plan to use the plugin for the solution, but find it difficult to choose:


What do you think about my choice? Can you recommend something?

It is necessary: – ease of code – adaptability – performance

Perhaps there is an option to do without a plugin?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


I think that the easiest way of doing so is to use the WordPress Recent Posts Widget and add your recent posts to your sidebar for example.

I would not really use a plugin as WordPress comes with a built-in widget to display recent posts anyway. To enable that inside your WordPress admin, visit Appearance > Widgets and add Recent Posts widget to a sidebar.

If you prefer to d this with code, you could use something like this and add it to your theme files:

// Define your WP Query Parameters
<?php $the_query = new WP_Query( 'posts_per_page=5' ); ?>
// Prepare your WP Query
<?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
// Get the Post Title with Hyperlink
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
// Get the Post Excerpt
<li><?php the_excerpt(__('(more…)')); ?></li>
// Repeat the process and reset once it hits the limit

Hope that this helps! Regards, Bobby