I think you may need to add global $post
after the loop starts based on a similar question found here.
<?php
while ($queryObject->have_posts()) {
$queryObject->the_post();
global $post;
?>
I wish I could explain more about why, but I didn’t have time to investigate further.
Related Posts:
- How to display liked posts of current user in wordpress?
- Query metas (and not : query posts by metas)
- Order by meta value pro first then meta value free in my search function
- Is there any way to get all custom posts and all custom terms with it’s meta in few queries?
- What is the best way to query posts based on live data?
- How can I create a meta_query with an array as meta_field?
- How can I query all users who registered today?
- Search custom post type by meta data
- Custom Queries: Joining On Meta Values From Two Custom Post Types
- WordPress creating excessive joins on meta_query with search
- Filter query posts by the count of metas for a meta key
- Save default value for empty or missing post meta
- Grouping related postmeta data via SQL query
- How can I apply a meta query for a single custom post type in the main query?
- How do I find if a page has a template?
- mySQL query. ORDER BY meta_key
- Remove posts from query for events whose start date has passed
- How to check current user in meta value array in WP_Query meta_query
- How to orderby multiple meta fields with another meta query
- Issue with using add_rewrite_rule() for post querying custom fields
- Query returning same results even though the ID changes
- Query posts according to specific post meta values
- get_users with array as meta_value
- Declaring a var, placing it in a query and using the output of the query?
- WordPress Mysql query and Duplicate
- WP_Query meta compare must include ALL array values
- Combining two meta_values within one row with query
- Excluding posts by meta, and also keeping posts without the meta
- How to “orderby” the first array in a meta_query that uses multiply keys?
- meta_query not working
- WordPress query: merge meta key (number) values and sort
- Query against multiple locations within single custom post type post
- Restrict WordPress search to a single ACF field
- Sort by postmeta on when searching
- Fastest and most efficient SQL query to check if UID exists
- Use $wpdb->get_results with filter based on array
- Query Posts that have or don’t have a meta_value and order by the same ASC
- meta query always fails even if data is correct
- Custom MySQL Query for Post and Post Meta
- list or get meta_key where meta_value is ‘something’
- WP_Query orderby meta key/value suddely stopped working
- Meta Query compare with LIKE pulls similar post types: 55 and 155, and 1,155
- How to display SQL query that ran in query?
- Custom WP_Query order by post_meta and (author) user_meta
- Perform query with meta_value date
- Meta query interfering with orderby relevance
- Count user posts by user ID, Post type and Post status
- get_post_meta causes database queries
- How to get sum of meta_values of a meta_key in wp_query according to conditions
- search through post-type attachments titles
- cron job to auto delete posts of a specific post type older than x days
- Most effective use of DB querys
- Two differents queries in archive page
- Meta Query for specific months
- My SQL function to change user_name
- How to retrieve elements from another table in a SQL query?
- WordPress Loop: List All Posts by a Category & Subcategory
- how would I create a custom query to get all users, and a related post based on a postmeta field?
- Display posts with a start OR end date later than current date
- Order posts by custom field DATE value
- Form redirect with query vars to page
- WordPress custom setting page – add flashing message
- Custom query AFTER rss fetch_feed not working
- list all categories that have a certain word in title
- Passing parameters to a static front page
- How to reset usual $query on search page to push custom $wpdb query there?
- How to query two meta fields and display results between them
- How to delete all posts, categories and tags from WordPress database
- Ideas how to search & replace post_content when string contains a newline?
- Query the WordPress database to get data together with replaced information
- $wpdb->prepare affecting the query?
- WordPress SQL search, how to handle SQL Injection?
- Query for Custom Post Type UI Does Not Loop All the Post
- How to manage a particular “order by” for get_search_query()?
- How can I get the name of term post meta value which equals term id
- get Insert id for meta field
- Trying to use WP_Query to return post with and without meta values
- Best way to sort estates and query them (for rent? yes/no. contains office space? yes/no)?
- get products by custom date variable
- Compare User meta_value with Product meta_value
- How to delete all images from code in all post_content
- wp query to use both author id and meta_query
- How to sort by two meta keys in admin area?
- Meta query orderby meta_value_num sorting by role first
- wp query multiple values > display a specific value first
- PHP Fatal error: Uncaught Error: Call to a member function insert() on null
- SQL query to delete users with multiple meta keys and comments
- Nested select statements not working
- Pagination adds search query (again)
- How to show all the associated posts with specific date of data metabox?
- Counting And Monitoring How Much Queries My Script Used
- Retrieve posts from meta key
- search.php is not generating the right results
- Slow query when joining wp_posts with a lookup-table?
- Filter the feed page post limit
- Mysql query and odd results
- How to get one result using wpdb class?
- Delete query won’t run
- Modify a query using both a text field and a true/false AFC field
- How to get posts that have certain meta key value and order based on another meta key’s value