Arranging posts in a custom order will be much easier if you use Meta Box plugin and the two extensions Meta Box Builder and MB Admin Columns. Compared to arranging posts by modifying the published date, which is time-consuming, Meta Box plugin and these extensions will do it more quickly in a blink of an eye for you.
First, you need to download the Meta Box plugin here. Besides the free plugin providing the framework to create custom fields, you might need to buy Meta Box Builder. It helps you create custom fields easily with intuitive UI. Or you can use a free online tool called Online Generator. If you’re a coder, you can code yourself and don't need these tools.
Additionally, you should use MB Admin Columns extension to manage the posts and view the order more easily in the WordPress admin.
After installing and activating these plugins, follow these steps below to manually reorder posts with Meta Box.
Step 1: Create a custom field to enter the ordinal number for posts
Meta Box Builder can help you easily create custom fields without touching any line of code. In the Dashboard, go to Meta Box > Custom Fields, click Add New button to create a new field group.
As we create a field to enter the number, you can choose Text field or Number by click Add New button here. Then, a new column on the right will appear to let you fill in the Title and Label of the field.
I named this field Order field
to easily identify it. Now, look at the field’s ID that I marked, you can use the automatically generated ID by Meta Box builder or replace it with your own ID for easy memorizing. After that, copy this ID to paste to the code in the next step. To finish this step, click Publish.
Step 2: Enter the custom ordinal number for posts
After creating the custom field, move to Post Editor, open a post that you want to reorder, and find the created field tab. In this tab, enter the number that you want this post to display and Updated the article.
To easily manage the order of posts, MB Admin Columns will help you create an ordinal column in the post list.
What you need to do is coming back to the Meta Box Builder. In the created custom field, choose Advanced > Custom settings, click Add New and enter these parameters:
You must use admin_columns
to integrate with MB Admin Columns. And after date
is the position to display the ordinal column so you can replace it with after tag
, after category
or any position as desire. Finally, don’t forget to click Update.
If you use code, simply add this code when you create meta box.
‘admin_columns’ => ‘after date’
Now when you go to the post list, you will see a new column displaying the value of the custom field we entered before. That’s so convenient to control and manage the post order, right? However, this extension is not compulsory so it’s optional to use it.
Step 3: Reorder posts on the front end
Your homepage still doesn’t display the post in the created order above unless you add these code to the ‘functions.php’
file of your theme.
function memory_custom_post_order_sort( $query ) { if ( $query->is_main_query() && is_home() ) { $query->set( 'orderby', 'meta_value' ); $query->set( 'meta_key', 'mb_order' ); $query->set( 'order', 'ASC' ); } } add_action( 'pre_get_posts', 'memory_custom_post_order_sort' );
'pre_get_posts'
: the hook that fires just before the post query is createdis_home()
: ensure that the reordering happens on the homepage only.query->set( 'orderby', 'meta_value' )
;
$query->set( 'meta_key', 'mb_order' )
;
$query->set( 'order', 'ASC' )
;
These 3 lines arrange your posts in ascending order according to the value of the field with id'mb_order'
. Replace‘mb_order’
with your field ID if you use another ID.
‘ASC’
: display your post in ascending order.
After saving the code, go to your homepage to see the result. You see, your posts are reordered as you want.
Final thought
Instead of changing the published date to organize your posts, now, you just need a few simple steps with the help of the Meta Box plugin and the Meta Box Builder extension. Even if you are not a coding expert, the above steps are not difficult for you, right?
Other case studies you might be interested in
- Create A Dynamic Landing Page in WordPress Using Custom Field
- Create a Filter to Find Hotels by Location
- Create an OTA Website Like Booking.com with Meta Box Plugin - P1: Create a Page to Introduce Hotel Rooms
- Create an OTA Website Like Booking.com with Meta Box Plugin - P2: Create Filters on the Archive Page
- Create an OTA Website Like Booking.com with Meta Box Plugin - P3: Create Filters for Single Hotel Pages
- Create Dynamic Favicon in WordPress using Meta Box plugin
- Create Posts Series in WordPress Using Meta Box
- Display a User List On the Frontend with Meta Box
- Display The Latest Products Section - P2 - Using Meta Box and Elementor
- Display The Latest Products Section - P3 - Using Meta Box And Oxygen
- How to Add Custom Fields to Display Banners using Meta Box Plugin
- How to Add Guest Authors and Guest Posts - Using Meta Box
- How to Add Related Posts to WordPress Using Meta Box
- How to Build a Hotel Booking Website Using Meta Box - P1
- How to Build a Hotel Booking Website Using Meta Box - P2 - Booking Page in Backend
- How to Build a Hotel Booking Website Using Meta Box - P4 - Booking Management Page
- How to Build a Hotel Booking Website Using Meta Box – P3 – Booking Page for Customer
- How to Create a Classified Ads Website using Meta Box
- How to create a FAQs page - P5 - Using Meta Box and Breakdance
- How to Create a Product Page - P2 - Using Meta Box and Oxygen
- How to Create a Product Page - P3 - Using Meta Box and Bricks
- How to Create a Product Page - P4 - Using Meta Box and Elementor
- How to Create a Product Page - P5 - Using Meta Box and Gutenberg
- How to Create a Product Page - P6 -Using Meta Box and Breakdance
- How to Create a Product Page - P7 - Using Meta Box + Kadence
- How to Create a Product Page - P8 - Using Meta Box and Brizy
- How to Create a Product Page using Meta Box Plugin
- How to Create a Recipe - P2 - Using Meta Box and Oxygen
- How to Create a Recipe - P3 - Using Meta Box and Elementor
- How to Create a Recipe - P4 - Using Meta Box and Bricks
- How to Create a Recipe - P5 - Using Meta Box and Zion
- How to Create a Recipe - P6 - Using Meta Box and Brizy
- How to Create a Recipe - P7 - Using Meta Box and Breakdance
- How to Create a Recipe with Meta Box Plugin
- How to Create a Simple Listing - P2 - Using Meta Box and Bricks
- How to Create a Team Members Page - P1- Using Meta Box and Elementor
- How to Create a Team Members Page - P2 - Using Meta Box and Oxygen
- How to Create a Team Members Page - P3 - Using Meta Box and Bricks
- How to Create a Team Members Page - P4 - Just Meta Box
- How to Create a Team Members Page - P6 - using Meta Box and Breakdance
- How to Create a Video Gallery Page - P2 - Using Meta Box + Bricks
- How to Create a Video Gallery Page - P3 - Using Meta Box and Breakdance
- How to Create a Video Gallery Page - P4 - Using Meta Box + Elementor
- How to Create a Video Gallery Page - P5 - Using MB Views
- How to Create a Video Gallery Page Using Meta Box + Oxygen
- How to Create ACF Flexible Content Field with Meta Box
- How to Create an Auto-Updated Cheat Sheet in WordPress
- How to Create an FAQs Page - P1 - Using Meta Box and Elementor
- How to create an FAQs page - P2 - Using Meta Box and Oxygen
- How to create an FAQs page - P4 - Using Meta Box and Bricks
- How to Create an FAQs Page -P3- Using Meta Box
- How to Create Buttons with Dynamic Link using Custom Fields
- How to Create Category Thumbnails & Featured Images Using Custom Fields
- How to Create Download and Preview Buttons - P1 - Using Meta Box and Bricks
- How to Create Download and Preview Buttons - P2 - Using Meta Box and Oxygen
- How to Create Download Buttons Using Custom Fields with Meta Box Plugin
- How to Create Menus for Restaurants - P1 - Using Meta Box and Elementor
- How to Create Menus for Restaurants - P2- Using Meta Box and Bricks
- How to Create Online Admission Form for School or University
- How to Create Online Reservation Form for Restaurants using Meta Box
- How to Create Relationships - P1 - Using Meta Box and Oxygen
- How to Create Relationships - P2 - Using Meta Box and Bricks
- How to Create Relationships - P3 - Using MB Views
- How to Create Taxonomy Thumbnails & Featured Images - P2 - Using Meta Box and Oxygen
- How to Display Images from Cloneable Fields - P1 - with Gutenberg
- How to Display Images from Cloneable Fields - P2 - with Oxygen
- How to Display Images from Cloneable Fields - P3 - with Elementor
- How to Display Images from Cloneable Fields - P4 - with Bricks
- How to Display Opening Hours for Restaurants - P1 - Using Meta Box + Gutenberg
- How to Display Opening Hours for Restaurants - P2 - Using Meta Box and Oxygen
- How to Display Product Variations - P1 - Using Meta Box and Gutenberg
- How to Display Product Variations - P2 - Using Meta Box and Oxygen
- How to Display Product Variations - P3 - Using Meta Box and Bricks
- How to Display The Latest Products - P5 - Using Meta Box and Bricks
- How to Display the Latest Products - P6 - using Meta Box and Breakdance
- How to Display the Latest Products - P7 - Using Meta Box + Kadence
- How to Display the Latest Products Section - P4 - Using Meta Box + Zion
- How to Display the Most Viewed Posts - P1 - using MB Views
- How to Display the Most Viewed Posts - P2 - using Meta Box and Oxygen
- How to Display the Most Viewed Posts - P3 - Using Meta Box and Bricks
- How to Filter Posts by Custom Fields - P2 - using Meta Box and FacetWP
- How to Manually Reorder Posts with Meta Box
- How to Show Featured Restaurants on Homepage - P1 - Meta Box + Elementor + WP Grid Builder
- How to Show Posts With a Specific Criteria - P3 - Using MB Views
- How to Show Posts with Specific Criteria - P1 - Using Meta Box and Bricks
- How to Show Posts with Specific Criteria - P2 - Using Meta Box and Oxygen
- How to Show Posts with Specific Criteria - P4 - Using Meta Box + Breakdance
- How to Show Posts with Specific Criteria - P5 - Using Meta Box and Elementor
- How to Show the Featured Restaurants - P3 - using Meta Box and Oxygen
- How to Show the Featured Restaurants - P4 - Using MB Views
- How to Show the Featured Restaurants - P5 - Using Meta Box and Elementor
- How to Show the Featured Restaurants - P6 - Using Meta Box and Zion
- How to Show the Featured Restaurants Section - P2 - Using Meta Box and Bricks
- How to Use Custom HTML Field to Output Beautiful Texts or Output Custom CSS
In many articles images dont working =(