Help Center

How to Order Posts by Date in the Posts Widget

How to Order Posts by Date in the Posts Widget

This tutorial will be helpful if you need to display your posts in a certain order by date in the JetElements posts widget.

WP Query Generator tool allows you to create any type of custom query really easily. In this tutorial, we will show you how it works on the example of the query that sorts the posts according to the publication date.

An order based on the publication date is the most common for posts. By default, it is the descending order, when the most recent post is shown first. You might need to change it to ascending order when the latest posts are shown last.

Let’s take a look at how the order of the posts could be changed by inserting a custom query.

1 Step — Generate the query

Open the page where you have placed the posts grid with Elementor page builder, find the Posts widget, and click the “Edit Posts” button. If you haven’t yet created the posts grid or slider – check out posts grid or posts carousel creation tutorial.

After that, let’s navigate to the WP Query Generator tool. Open General tab and specify the following conditions for your new query:

  • Post type: post;
  • Post status: Publish
  • Order: ACS (stands for ascending order);
  • Order by: date.
WP Query Generator

Copy the generated query to clipboard and return to Elementor editor. Open Content > General and enable Use Custom Query option. Paste the generated code to the Set custom query text field.

Set custom query

Well, that’s all. Now you know how to generate and apply custom queries to the posts.

Was this article helpful?
YesNo

Need help?

Ask Facebook community

Get answers from 22K Crocoblock Community experts from all over the world.

Start a live chat

Ask question to support agent and share its details via chat messages.