Bobcares

Reorder Posts in WordPress: How to?

by | Jul 2, 2023

Let us take a closer look at the reorder posts in WordPress. At Bobcares with the assistance of our WordPress support services, we can give you a detailed overview on how to reorder the posts in wordpress.

 

How to Reorder Posts in WordPress?

We can use five main methods to reorder posts in WordPress, they are listed down below. Make sure to go through every one of them to find a suitable option.

reorder posts in wordpress

Method 1: Change Post’s Published Date

This is the simplest way that allows us to reorder posts or content utilizing WordPress’s built-in capabilities. WordPress, as we know, displays posts in reverse chronological order depending on their publishing date (newer posts first). Changing the publish date of a post will also modify where it appears in the list. 

For example, if we wanted to bring up an older post, we would have to update its date to something more recent. Similarly, we may edit the date of a post to make it older if we wish to move it down. Simply edit the post we want to re-order and click on the publish date beneath the Document panel on the post edit page.

This will provide a date and time window where we may edit the published date and time of the post. To save the changes after altering the date/time, click the ‘Update’ option.

We must choose a date that is relevant to previous entries. For example, if we wish to show an earlier article before another post published on May 8, we must update the post’s publish date to May 9.  

Method 2: Use Post Types Order Plugin (Drag and Drop)

If we want to reorder posts in wordpress but don’t want to change their publish dates, then we have to follow this method. To begin, we must install and activate the Post Types Order plugin.    

After activation, we must go to the Parameters » Post Types Order page to modify the plugin’s settings. From here, we need to select the post types where you want to enable the plugin. After that, simply click the ‘Save settings’ button to store the changes.

We can now simply go to Posts » All Posts and drag and drop posts to re-order them. The Post Order Types plugin also allows us to drag and drop specific custom post types to reorder them. Custom post types enable us to generate several content types for the website.  

Method 3: Use Drag and Drop in WooCommerce

To re-order products in the online store, we may utilize the Post Types Order plugin, but WooCommerce already supports drag and drop. 

Simply go to Products > All Products and click the ‘Sorting’ link at the top of the page. We will then be able to rearrange the products using drag and drop. Simply click the ‘All’ link at the top of the screen to stop sorting.

Method 4: Use Sticky Posts Feature in WordPress

In this method to reorder posts in WordPress, sticky posts are a default feature in WordPress that does this. We can use the sticky posts functionality to highlight a post above all other posts on the blog page.

Simply make changes to the blog post we want to pin to the top. Check the box next to the ‘Stick to the Front Page’ option in the ‘Document’ section on the post edit page. Then, to save the changes, click the ‘Update’ option.

We can now go to the website and see the chosen content pinned to the top. The sticky post will be highlighted differently depending on the theme.

Method 5: Modify WordPress Query using Code

In this method to reorder posts in WordPress, we can change the default WordPress query. This solution necessitates the addition of code to the theme’s functions.php file. If we haven’t already done so, see our guide on how to copy and paste the code in WordPress. Take a look at this code piece as an example. It enables us to show posts in chronological order.

//function to modify default WordPress query
function wpb_custom_query( $query ) {
// Make sure we only modify the main query on the homepage
if( $query->is_main_query() && ! is_admin() && $query->is_home() ) {
// Set parameters to modify the query $query->set( 'orderby', 'date' ); $query->set( 'order', 'ASC' ); }
}
// Hook our custom query function to the pre_get_posts
add_action( 'pre_get_posts', 'wpb_custom_query' );

This code simply modifies the orderby and order parameters in the default WordPress query. However, because some plugins or themes already modify the default query, this code may not always operate as expected. To correct this, we can use the suppress filters argument as follows for an effective reorder of posts in wordpress.

//function to modify default WordPress query
function wpb_custom_query( $query ) {
   
// Make sure we only modify the main query on the homepage 
    if( $query->is_main_query() && ! is_admin() && $query->is_home() ) {
   
        // Set parameters to modify the query
        $query->set( 'orderby', 'date' );
        $query->set( 'order', 'ASC' );
        $query->set( 'suppress_filters', 'true' );
    }
}
   
// Hook our custom query function to the pre_get_posts
add_action( 'pre_get_posts', 'wpb_custom_query' );
 

[Need assistance with similar queries? We are here to help]

 

Conclusion

To conclude we can reorder posts in wordpress within a few simple steps directly from the WordPress interface and we have seen how to do it with the support of our tech support team.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

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

Never again lose customers to poor
server speed! Let us help you.