My pre get posts functions went sideways. My condition was applying for all archives, not just the events one. Here is the code that is right. Notice the is_post_type_archive.
function pix_change_query( $query ) {
if ( is_post_type_archive('pix_events') && $query->is_main_query() ) {
$query->set( 'orderby', 'meta_value_num' );
$query->set( 'meta_key', 'date_work' );
$query->set( 'meta_type', 'DATE' );
$query->set( 'order', 'ASC' );
$query->set( 'meta_query', array(
array(
'key'=>'date_work',
'compare'=>'>=',
'value'=>date('Ymd'),
'type'=>'DATETIME',
)
) );
return;
}
}
Related Posts:
- Permalinks: custom post type -> custom taxonomy -> post
- How to Add Tags to Custom Post Type?
- How come Featured Image isn’t showing up in my Custom Post Type?
- Adding ‘menu order’ column to custom post type admin screen
- Efficient Taxonomy Intersection
- How to create a wp_query that contains both meta_query and tax_query
- Display custom post type and custom fields within a Bootstrap Carousel
- Custom post type support for get_users(‘orderby=post_count’);
- Notice: map_meta_cap was called incorrectly
- Archive page…limiting posts per page
- Seperating Custom Post Search Results
- WP 3.1 – archive pages for custom content types possible now without a plugin?
- Use WP_Query object inside a function
- WP_Query search custom posts meta date fields
- How to have a custom URL structure for a custom post type?
- Custom permalinks – post type – hierarchical taxonomy’s
- specify meta_key / meta_value condition for prev_post_link and next_post_link
- How do I create new content pages for my Custom Post Type?
- Using new WP_Query in shortcode in a custom field causes the main post content to not display
- Listing and accessing categories for a custom post type
- Disable adding of new post (custom post type)
- Taxonomy posts on Archive page
- Taxonomy list. Order by a specific custom post type count
- Rewrite CPT slug with two taxonomy slug instead of one
- Creating a simple pagination for custom post type templates
- Custom post types and permalinks : What a mess !
- Custom content type meta_box_cb does not run
- Category and post tag archives do not include posts from custom post type
- Get the title of custom post type in another loop
- Displaying different custom post types under one admin menu
- Custom Post Type Alerts
- Can I change the slug of my archive page on a Custom post type?
- How to best delete orphan wp_postmeta
- Automatically populate a hierarchical taxonomy from a custom field
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- How to set up htaccess to redirect a particular post type or subdirectory to HTTPS?
- Custom Post Type Metabox – Not Saving
- WordPress Orderby Numeric Value Not Working
- Cherry framework adding custom post type
- Replace title column in post list with post meta value
- Include custom post type single template, but respect theme override of template if it exists
- How to have custom post type /example/ and then posts /example/posts.html
- Multiple Loops On Custom Post Type Template?
- Custom Taxonomy Doesn’t Show Up
- Cannot add custom field to “orderby” parameter in Rest API
- Not Able to Get Custom Post Type Gallery Images URL
- Incorrect post_type in url of taxonomy term
- Custom post type and custom taxonomy with the same slug using the file page taxonomy only as directory
- Building a Treatments Page, What Do I Use?
- list archives per post types
- How do I programmatically create new posts of a custom post type over the XML-RPC API?
- Migrating a taxonomy’s tags to the native category
- Make custom post types and pages place nice, re: rewrite
- PHP question: how to combine syntax?
- Why do I have to press the “Update” button twice to save my meta box values?
- TinyMCE Buttons on Certain Post Type
- How to create connection among state, city, store and store number based on URL
- filter by custom taxonomy using ajax
- How to get the current category with custom posts
- Modify Posts from Custom_Post_Type within the plugin
- Importing JSON feed giving Notice: Array to string conversion error
- Page listing all categories for CPT
- Change permalink for custom_post_type using custom_post_meta (woocommerce)
- Grab all Custom Posts by multiple taxonomies and terms
- Custom Post Types and Complex Content Hierarchy
- If custom taxonomy else conditional [closed]
- updating one custom meta field only
- How do I “trash” a custom post type post while logged in as Admin
- Pagenavi Plugin and Custom Post Type – Multipage results
- Easy-Post-Type is visible in search, but 404 when clicked
- custom filtering admin columns
- How to display custom taxonomy term specific post?
- Can Someone help me to create Short Code for displaying a category posts
- Remove Header and style.css from Specific Post template
- How to remove default modules on single event page on Modern Events Calendar
- Show posts from WP Custom Post Type selected from a field in a metabox
- WordPress post not executing shortcode until updated
- Keep custom read more link on the same line as excerpt text
- How to make a custom search template for custom taxonomy?
- Custom Post Type
- Force WordPress to only match URL in category
- How can I use WP_Query argument ‘Like %..%’?
- Can I create a taxonomy term that mirrors the name of a new custom post?
- Ads below footer
- Rewrite for custom type and custom taxonomy
- How to create TEMPLATES for TAXONOMIES? What I have to change in this code?
- Custom Post Status & Taxonomies
- Query child posts on parents single.php?
- custom post type for custom talbe
- Show custom post along with default post
- Template with Custom Post Type (Custom Tables) does not work
- How to add a post counter to the list of custom taxonomy terms?
- Custom Post Type and Taxonomy pagination permalink
- Ordering custom posts
- Custom post type – update_meta not working
- Customising wordpress search and using $_GET[“s”]
- Where do I insert to? [closed]
- WooCommerce – Complete Order when an action occurs
- A call to list all Custom Post Types?
- How to debug a 404 error on pages whose content is perfectly displayed when I explore it?