Ordering posts in Search & taxonomy by post_meta
You have a couple of issues with the code you are trying. To check the query is for your CPT archive: You are using $query->is_post_type() but it doesn’t work (as far as I know, its not even a function). Instead you can use either: if (is_post_type_archive(‘business’)) {…} or (if its not only on the archive … Read more