Because you save your data as appointment-start-date
(hyphens), but in your orderby handler you use appointment_start_date
(underscores).
They need to match!
$query->set( 'meta_key', 'appointment-start-date' );
Related Posts:
- Custom Taxonomy as checkbox or dropdown
- how to group custom post types
- Page as child in custom post type slug?
- Number of pages – multiple (custom) post types
- Limit widget to a specific registered sidebar
- How to filter post data with AJAX on page?
- Get latest 4 post on a custom post filtered by category
- Add Capabilities to Custom Post Type after it has been created [duplicate]
- Hook when adding or editing a specific custom post type? [closed]
- Get child terms of current term of the current post
- Allow duplicate slugs for posts on Custom post type in different categories/taxonomy?
- Assign category to front end post
- wp_query and comment_parent – select only posts with top level comments
- Remove Post Page “View Post” Link
- WordPress Template Hierarchy
- Taxonomy structure of Sport site
- How can I add a column in the wp_list_table of the admin area?
- Custom Post Type with static page for archive
- How to filter the description of a custom post type
- Automatically adding meta data to posts or multiple query help
- Make Custom Post Behave Like Normal Post?
- Trigger “unsaved changes” dialog for custom post meta changes
- How does the $post_type global variable work?
- how to check if custom post type exists in wordpress
- Sending an email when a CPT is saved/updated (NOT when it’s created)
- Archive slider for CPT
- Automatically update custom field in all posts of a custom post type
- Custom post type not showing in admin menu
- Custom taxonomy in custom post RSS feed
- Set up Custom-Post-Type Author Archive
- How to display product subcategories into my custom post type single page
- Custom Taxonomies not appearing in Admin
- How to create custom post type like Page
- Notice: Undefined index: error and understanding wordpress
- Problem loading custom post type admin page
- Display content based on a users login
- Can taxonomies of custom post types be used with category actions?
- Advanced Custom Fields Plugin – Conflict with Custom Post Type Default Editor
- Add custom field to Posts and sort by it
- 404 error when navigating to a taxonomy page with Cyrillic, what’s wrong?
- Custom post type as home page with custom url
- post tag texonomy rename getting error
- Creating a Custom Post Type
- WordPress Doesn’t Generate Taxonomy Archive
- How to give all CPT a folder automatically based on their slug
- How to make front end form only accept certain values
- Organize WordPress site, so it can maintain with huge database
- How do you create a custom template to display a category with an image and related posts below?
- Can a shortcode included in post content add styles to the ?
- Category.php template for custom posts
- Remove permalink for custom post type
- custom post data – how to
- How can i link a custom post type thumbnail to intermediate size
- Category archive in with conjunction with custom post type is empty
- Custom post doesn’t show featured image
- What do the numbers mean at the end of add_action(‘save_post’)…?
- How can I add a shortcode to query Custom Post Type with ACF in WordPress?
- How can I trace inconsistency in loading a template?
- Custom Meta Box returns no HTML
- Get posts from Custom Taxonomy
- Custom Post Type archive redirects to home
- postsperpage value not being applied
- Removing numerous Meta boxes from numerous CPTs
- Modifying Dashboard edit.php
- How to import database table as custom post type and custom fields?
- Have custom post type Visibility be private by default, and have radio button also set to “Private”
- How do I add multiple post types to this query?
- Fill custom fields when saving custom post types
- Using custom post type as front home page pagination not working
- Migrate Custom Post Type with Custom Fields data and parent child order
- pagination for custom post type archive page
- Add custom posts to submenu automatically
- How to create review point system for CPTs (many-to-many relationship)
- Is it possible to get the specific content on the search page?
- Search for custom field input of a custom post type in ajax live search
- Register custom_post_type from static function
- WordPress custom post type as homepage with homepage url
- show label text of select option rather than its value in cmb2
- How to select meta key in custom database query
- localize_script or rest api
- Add content to wordpress edit.php page
- Search result based on URL
- Widget area for individual posts (custom post type)?
- Custom Post Type with Subfolder in Custom Theme
- Link two different post using there post_id in post meta
- How do I extract the contents of a CPT’s custom field for all posts?
- Excert ( the_excerpt(); ) Not working properly
- Keep same archive.php for post from archive?
- Use one template for different custom post types with the same markup
- Events with multiple event dates + permalink for each date
- After rewriting post type’s URL, the number of queries has increased dramatically
- Custom field totals
- How to Associate Posts with Pages
- How to query custom post then display sections by meta value
- Prevent users from changing post status
- How do I paginate a custom post type listing on a custom template page?
- A to Z list for custom post types
- What is the code for showing Custom Category and Subcategory Page?
- get_the_post_navigation not working
- Sort ACF by custom taxonomy