I have a custom post type (CPT) called
property. I have registered a featured property
metaboxfor it as explained in this question "How do I create a featured post within a custom post type?". So a featured property has got
What I would like to do is to display all
property posts, but order them by
meta_key='property_featured'. So that featured properties will appear first in the list on the first page. Similar behavior as
Sticky Posts functionality. And all the rest
property posts will be ordered by date created. Also, I need to make sure that pagination is working correctly - treating all the
property posts alltogether. I use custom pagination code explained here. (Hope that makes sense).
I have tried to specify arguments for WP_Query. However, if I specify:
'meta_key' => 'property_featured', 'orderby' => 'meta_value'
property posts with that key are displayed as opposite to all
If I delete
meta_key from arguments then the query doesn't know what to sort them by.
How do I display all the
property posts, making sure that
featured ones appear first and all other
property posts order by published date?
Many thanks, Dasha