Custom post type: No posts found even if counter has a count
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’, … Read more