Any help will be much appreciated. I would prefer a wordpress plugin. But if there is none, I don’t mind having a php code to help me. Bear in mind please, I am no php expert.
I saw this on the wordpress codex but do not know how to use it:
function wp_list_sort( $list, $orderby = array(), $order = 'ASC', $preserve_keys = false ) {
if ( ! is_array( $list ) ) {
return array();
}
$util = new WP_List_Util( $list );
return $util->sort( $orderby, $order, $preserve_keys );
}
2
Answers
You can try with this plugin to sorting your Posts and Post Types
It’s a powerful plugin, Order Posts and Post Types Objects using a Drag and Drop Sortable JavaScript capability.
basically, you can order from your dashboard by this plugin but you can make it for the frontend as well but you need to do a few custom codes.
Here is another solution you may try it on your frontend code :