If your post type slug is placement
, and you set has_archive
to true
, then the archive WordPress generates is at /placement/
. Set has_archive
to placements
instead and let WordPress add the rewrite rules (which will also handle pagination properly).
Then, to order by your meta key, add a function hooked to pre_get_posts
, check if the query is_main_query()
and is_post_type_archive( 'placement' )
, then set your meta_query
parameters there.