For me, this was happening b/c of post meta cache issues. This article suggested code which solved my issue – and apparently many other’s as well.
Here is the code he provides:
function jb_pre_get_posts( WP_Query $wp_query ) {
if ( in_array( $wp_query->get( 'post_type' ), array( 'my_post_type_1', 'my_post_type_2' ) ) ) {
$wp_query->set( 'update_post_meta_cache', false );
}
}
// Only do this for admin.
if ( is_admin() ) {
add_action( 'pre_get_posts', 'jb_pre_get_posts' );
}
Related Posts:
- When should you use WP_Query vs query_posts() vs get_posts()?
- Get post ids from WP_Query?
- Some doubts about how the main query and the custom query works in this custom theme?
- Wp get all the sub pages of the parent using wp query
- How to query for most viewed posts and show top 5
- Query Posts in a Predefined Order
- WordPress Custom Query to show posts from last x years
- Get posts by meta data OR title
- Perform query with meta_value date
- Using is_main_query to select custom post type on certain page
- WP_Query ordered by custom field that is a date string?
- get_the_title($postID) OR get_the_title()?
- Display Posts by modifying the where clause only for my query
- How do I create my own nested meta_query using posts_where / posts_join?
- How to use filter hook posts_join for querying taxonomy terms in posts_where?
- Best practice for multiple queries on page
- How to Get All Posts but the Private ones?
- How to query ‘posts_per_page’ to display a different blog posts index template?
- How to find out what “Blog pages show at most” is set to [duplicate]
- Retrieve or Query Pages by ID
- WP query exclude post within the last month / only show over 1 month old
- WordPress query for most recent posts from multiple categories
- How do you query wordpress posts using a math formula between multiple meta field values?
- How to implement time filter to show random post 1 month for one category and 3 months for other categories
- Too many posts cause slow load when paginating
- Multiple instances of Featured Image Query
- How can I pick a single post from the latest 3?
- How do you Query posts with nothing in common?
- Query post with meta_query where date is not in future
- Order a query result by a numeric meta key even if it does not exist, but put the posts with meta key first
- Query with custom taxonomy not working
- Query posts by specific word on title
- WP_Query last five posts, simply ordered by meta_value
- WP_Query “OR”: Find posts by ID, Name or Post Title?
- Store sticky post’s ids in a transient
- How to build a WP_Query using mulitple tags and using AND or OR operator between them
- Multiple loops without repeating content
- WP_Query condition affects posts_per_page count
- Custom Query num_rows returns wrong amount
- Fetch Record based on meta key dates
- add active class based on permalink and url
- Bypass “supress_filters” in WP Query
- Slow page loads due to WordPress Core Query
- Filtering out child category posts from parent category archive not working
- Display custom tags on pages that have a specific page parent
- Is there a better way to pull in custom content without querying posts?
- How to query for all posts that have a particular meta key?
- Reset WordPress Post Query to default
- Advanced WP Query and/or
- Exclude All Posts Which Do Not Have A Tag Assigned
- How can I override one post and make it display content for another post?
- Get all posts which was posted on X Days WordPress
- How to create custom query by keyword in post title?
- Conditional operator OR not working with custom fields
- complex get_posts() query to select child pages
- Get posts that do not have the same tags as current
- Should I reset $wp_query?
- Posts query according to meta box date
- How can I comment comma-separated array values?
- Creating attachments archive in tags and categories
- How to use ‘WP_Query’ or ‘query_posts’ to display content in a descending order
- 2 queries with counters
- Multiple Query_Posts
- How to query for a page, get data, then query for child pages of that page
- Magazine style frontpage with multiple categories/loops and no duplicate posts
- Optimising WP_Query with ACF Fields
- Query post and sort by custom value calculated with custom field on cpt
- Query post ordered by meta value that show first post that contained a tag
- query hook parse_tax_query function takes no effect
- Duplice post with standard WP loop – fixed by using query_posts() instead
- ElasticPress is (aparently) messing with my search filters
- pre_user_query vs pre_get_posts
- Order by meta date with a thousanth of a second defaults to post order
- Custom query for custom post type not getting correct post ID
- Problem with my loops
- My entry results are not consistently alphabetized
- Merge two queries and remove duplicate
- How to order posts, that have already been filtered by custom taxonomy, by their category names?
- How to add in WP_Query to every 3 posts displayed? [duplicate]
- Seach and categories not working when ignoring sticky posts in main loop
- posts_per_page increment additional post
- Calling body_class and wp_nav_menu for a different post
- query_posts() doesn’t seem to be called in my page
- Modify query to exclude certain ids and certain parents and its corresponding children
- How to order by datediff in WP loop?
- how to exclude store in clipper theme wordpress code php
- Display post list within category list sorted by name [duplicate]
- Optimising specific Query with ACF meta objects
- When should you use WP_Query vs query_posts() vs get_posts()?
- query_posts with sorting on a custom datestamp
- How to query post ids liked by the Author
- Query Posts by date range with fixed beginning and end
- get contents and permalink from a specified page
- Help in query for list links
- Exclude categories and subcategories in QueryLoop
- WordPress pagination returns the same posts
- Incorrect posts displayed on category page
- WP Query – Show custom posts only if user contain some user meta
- Show number of posts AND number on current page (cannot make it work)
- new WP_Query with order args – no more distinction between categories