I realized the problem:
while ($the_query-> have_posts()) : $the_query->the_post();;
it now works OK
Related Posts:
- WordPress get_posts function, 1300 lines long
- Exclude a category if post is only in that category using wp_Query
- Too slow when using both ‘tax_query’ and ‘meta_query’ both in WP_Query
- Use of caller_ get_ posts
- Tax_query terms ID’s using variable
- Pagination custom query
- WP_Query and name__in
- Query certain amount of posts from multiple dates
- Order posts by tags count?
- Orderby = none not working [duplicate]
- Querying Multiple Custom Taxonomy Terms
- Unable to combine “search value” and “tax_query” using WP_Query
- How to extend tag and category “Related Posts” query to custom post_type if the first 2 terms have no posts
- WP_Query search for whole words
- WP_QUERY returns empty set when fired from a WP-CRON scheduled event
- Interupting the loop with extra divs to display data, and how to get it to work responsively
- WP_Query, tax_query and term_meta: How to?
- How do I reset this wp_list_categories query?
- Refine search results using WP_Query
- How to pass many ids in post__in?
- How to echo data after a WP_Query
- Query with a meta value inside a given range
- Pagination of a WP_Query Loop in a child-page page template
- Add condition of user capability in WP_query
- add_filter() depending on search term
- How do I run through a WordPress loop called from a filter function?
- How do I get the title of a category in a custom loop?
- Is it a good idea to improve meta query performance by adding tax query?
- WP_Query: Group events by year, sorted DESC; then by date for each year group, sorted ASC
- How to display user order by role
- WP_Query | Tax_Query Relation | Unable to use ‘OR’ as it then allows all products, help me finish my query?
- hide custom post types with specific meta key ON admin backend
- Orderby listing issue
- Check if loop has any categories?
- WordPress query with items from more than one selfdefined taxonomy as `term` argument
- Current post in AJAX call is always zero
- Multiple filter conditions for WP_Query
- Get all fields inlcuding “ACF” (Advanced Custom Fields) columns in wp_query
- get_post_meta in WP_Query
- WP_query : Force last posts number over Reading Settings
- Order by most used tag
- WP_Query results stored in variables
- infinite loop in wp_query using simple query
- How to display the number of posts in a category using WP Query
- wp query for popular post with simple field
- WP Query – posts only by specific user
- how can I get seperate the HTML in the_content(); output?
- Is wp_reset_postdata always necessary?
- wp_query: implicit paging? I get less posts that I should
- Specific html within wordpress loop
- WP Query Meta Value – How To Identify Specific, Unique Values?
- Get user first name from custom endpoint
- Shortcode Not Working in Slider When Added To Post Title
- Displaying pages on an archive page
- Multiple pagename WP Query
- How does WP generate the default $query in WP_Query based on the URL?
- How I can repeat 2 HTML templates in a WordPress Query?
- Loop categories by recent post
- custom page with post content using read more
- Meta query with compare by more than 2 fields
- Offset WP_Query by negative 1
- WP_Query orderby random do not repeat infinite scroll – one loop
- How go give $value to wp_query
- Show multiple tax_query from 2 or more post_type in a single code
- Disable (or limit) queries when certain content (or data) is not needed (or showed)
- How to make the ‘request’ filter work?
- How to use rewind_comments() – when and how to use it?
- How to make a query returning pages from multiple parents
- create a custom query for posts managed by Restrict Content Pro
- Filter for each loop when WP_Query has no posts to show
- Related categories order posts by category
- Why pagination is not working with tax_query param?
- Finding post ID dynamically on click
- paginate_links method doesn’t show second page of my custom wp_query
- Wp_Query Post per page not working?
- Order Element By Custom Field in WordPress
- Display All Top Child Categories / Taxonomy
- how to get custom attachment url?
- ACF Post Object meta-query by title not ID
- Case insensitive ORDERBY in wpquery
- Sorting with meta_query and multiple, optional meta keys
- getting posts by tags
- WP_Query & Duplicate entries
- Query child posts with tax query on parents
- How to break up output of posts for different terms on same page?
- From admin edit user page query either the user_nicename or username field value of the user profile being edited or viewed
- Calculating efficiently on large amount of data generated by wp_query
- Include post_status check within $wpdb query
- Return on a quest all these meta_value
- Complicated WP_Query
- Filter WP_Query output before it is accessed (pre_get_posts)?
- Custom query to show posts
- New WordPress WP Query using posts from certain categories
- Taxonomy related query not working
- How to show featured post first, then separate loop for other posts
- error with $query->have_posts()
- Multiple Orderby is not working right
- WP query based on two meta queries
- I want to capture the last day’s (today) posts in a category in the numbered order in acf
- How do I have multiple metaqueries inside one wordpress query