You are sorting it incorrectly. You will need to check for artist-status
meta key with meta_query
and sort by last-name
metakey.
Here is your query.
$args = array(
'post_type' => 'artist',
'posts_per_page' => -1,
'meta_key' => 'last-name',
'orderby' => 'meta_value',
'order' => 'ASC',
'meta_query' => array (
array(
'key' => 'artist-status',
'value' => 'invited',
'compare' => '=',
)
)
);
$loop = new WP_Query( $args );
Related Posts:
- List upcoming events, ordered by date in a custom field
- Display custom post types with custom date field value (before today) & order by custom date field
- Rewrite and custom post type: order by custom field not working
- Order Custom Post Type by Custom Field Value
- Add a custom meta box for client to order CPT posts how they want
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- Orderby if between two meta fields
- What’s the most efficient way to get two queries based on an if statement?
- Show first posts with custom field not empty and order all by title
- How to display custom post type ordered by a custom field date
- Order Custom Posts by Several Fields
- 404 on Pages for Custom Post Type & Query_Posts
- Custom Post Type Data in Sidebar widgets?
- Order by & include array by specific post ids
- Hide custom post type field from author?
- Many to Many Relationship between Two Custom Post Types
- Sorting a query by custom field date
- wordpress plugin error handling
- Creating Photo Gallery System with Custom Post Type
- Set post title from two meta fields
- WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
- How to sort CPT by custom meta value (date), and return posts month by month
- How to solve suspected memory issue in custom WordPress loop?
- Trying to save custom post type from frontend partially working
- Custom Taxonomy order by Custom Field
- Is there any performance consideration when using Custom Post Types?
- How to query different post types in specific order?
- Custom Post Type Navigation on Custom Field
- how to interconnect custom post types?
- WP All Import – Using Xpath to set a select value
- Adding dropdown select meta box to custom post type – seems restAPI is interfering
- Show listings from Impress Listing plugin in random order using taxonomy and terms
- Wp_query: sort by PHP variable
- Allow user to set custom order to a list of custom taxonomies?
- search also in taxonomy, tags and custom fields
- Filter custom posts using auto populated dropdown selectors
- Querying Two Custom Post Types with OR Not Working
- How can I get the number of custom post type posts that have a specific attachment image set?
- Bulk Update Custom Fields for Custom Post Types
- Two Custom Post Types Many to Many Relationship
- Using advanced custom fields from one custom post type in another custom post type / using nested shortcodes
- filter custom post in rest api with custom function
- Custom Fields for Custom Post [closed]
- Displaying All Posts of a Custom Post Type in WordPress Multisite Backend
- Adding Page Templates to post but it ignored it
- Is there any way to add a “custom field” to the CPT archive page?
- Ordering custom post type by multiple custom fields
- Order by custom field meta_key date and then by custom file meta_key number
- don’t publish custom post type post if a meta data field isn’t valid
- WebP Fallback for Inline Background Image in Style Attribute
- How can meta boxes be added to “unknown” custom posts?
- Custom “radio button meta box” not saving correctly
- Check if post with same meta value exists
- Get Post Terms of Current Post (selected taxonomy term) – How to get only the taxonomy value and not “Array ( [0] => taxonomy term )” in the frontend?
- WP Query ‘posts_per_page’
- Custom Post Type Metadata Not Saving
- Editor / Add Media: Is it possible to only allow galleries?
- A meta box (in a custom post type) with two different type of fields
- Many to many to many custom post relationships
- copy images from custom field to another custom field
- Custom Query: If One Post Object Field Value Is The Same As Another
- Sum and count of custom field values
- Cannot obtain custom meta information
- How to use a specific custom field in a custom post type as slug
- How do I show my containing my custom field ONLY if there is a set value on that custom field? [closed]
- Custom post types category
- “Custom Field” to Excerpt field” for pages? [closed]
- Let users upload image(s) to the post from front end
- Custom Taxonomy dont save in a frontend form for post a custom post
- Update custom field value
- Insert custom fields to a custom post type
- Should i use custom post type for a custom footer?
- show most viewed posts of last days by link?
- A sports wordpress website
- How do I ensure that post_type and Taxonomy use the same slug?
- How to make an API call to a custom post type but filtering by meta value?
- Custom taxonomy terms as children of multiple custom post types
- Custom Post Type meta data getting deleted on bulk editing taxonomies
- Custom Form / Search with Custom Post Type Data
- Custom Column in CPT admin table not updated after Quick Edit save
- How to access repeater field of a custom field?
- PHP Warning with Custom Fields
- Custom post types & Pages hierarchy – Error 404
- filter rest api post by a acf filed
- How to prepend text to custom field value A, but only if custom field value B matches a certain string?
- Custom post type that lets users create a set of posts?
- Delete custom post type metadata without deleting the post in admin area
- Creating multiple CPT posts from one Gravity form
- Converting a checkbox filter for custom fields to a dropdown
- Function not pulling image or text from custom post type
- If i have custom post type with 5 custom fields do i have to create a new loop to reference each one?
- Repeatable custom meta select boxes
- How to show animal lineage/pedigree in WordPress?
- Types plugin isn’t compatible with my custom post type
- Show Posts in Vertical Tabs with Scrollbar
- How do I filter a custom post type loop by a field?
- How to order different custom post type in category or tag template page?
- Custom Post type as Taxonomy
- Display div based on Group metabox selection [closed]
- WP Query + custom fields: How to query event posts from the current date backwards 6 months and organize it month by month?