As Howard E said, without knowing more about what and how you want to reorder it’s difficult to give you useful advice. Here’s a good breakdown of the options and, here are some places to start.
- If you want an array of posts to order your own way, you can use the native function
get_posts()
in order to create an array of posts based on selected arguments. More info here. - If you want to modify the existing loop on your archive page and order youor posts with custom arguments, you can use
pre_get_posts()
- If you want to write use existing WordPress arguments to order your posts, you can write a custom query using
WP_Query
and the ordering arguments it already supports.
Update
Since you want to sort your posts by a custom ACF field, here’s how to do that with get_posts()
:
// get posts
$posts = get_posts(array(
'post_type' => 'event',
'posts_per_page' => -1,
'meta_key' => 'start_date',
'orderby' => 'meta_value',
'order' => 'DESC'
));
ACF has an entire page dedicated to sorting by custom field. You shouldn’t need to put the posts back in an array in order to sort them.
Good luck!