Please forgive me if my question isn't the clearest and I'm not using this exactly correct... I've never posted before.
I am trying to setup a query on a real estate website that I'm developing that will give precedence to the company's listings (a custom post type) before showing the other listings (of the same custom post type), based on the value of a custom field. Inside of my meta_query array, I can add an array such as the following below to show the office's listings by means of a custom field on the post:
array(
'key' => 'office_name',
'compare' => 'LIKE',
'value' => 'XYZ Realty'
),
Using the snippet above in my query grabs the office's listings as expected, but only "their" listings (or those posts that have their office name in the custom field).
For sorting purposes, I am using the following to sort by price, which is another custom field on my custom post type ("listing"):
'meta_key' => 'price',
'orderby' => 'meta_value_num',
'order' => 'DESC'
Which also works as intended. So with that... is it possible to tweak the query so that it will give the office's listings a priority or precedence to be shown first and then those that are not theirs immediately following?