You are missing the the_post() function call in the loop. Just add
$the_query->the_post();
in your loop. Apart from that, your loop should work
EDIT
You should also not forget to reset your postdata after the query is done
Related Posts:
- How to get any tag ID
- Show all parents and children in custom post type in right order
- How to get user_id from wordpress database inside ajax function?
- wp_query for displaying attachments with a tag
- How can I get an array of all IDs from the current queried object?
- How can I pick a single post from the latest 3?
- How do I search inside specific taxonomies in WordPress
- Get posts by list of post IDs ordered by those IDs?
- how would i change post->ID to work correctly when querying pages?
- get term id from term name
- How do you determine if a result in a search query is a post or a page?
- Custom wp_query differs on index page and category page
- Compare “Main” post ID to ID inside wp_query loop
- Determine if ID is page or post and query the ID
- Show multiple tax_query from 2 or more post_type in a single code
- Display posts from an array of ID’s
- paginate_links appearing on page but it doesn’t actually paginate – pagination on a static page with a dynamic `post_type` argument on a static page
- WordPress private post won’t display to other admins
- Only show tag with the same id as the post
- post_type not working when tag__in is present?
- Issue attempting a wp_query_posts with tags
- Issue with WP_Query (need a array of selected ID’s)
- Custom query for certain post type OR another post type with a certain category
- after refresh the id that shows correct in first time click, changes to 1
- How to print the excuted sql right after its execution
- Pagination returns 404 after page 20
- Make a WP Query search match exactly the search term
- How to query posts of standard post format. For real
- Orderby menu_order doesn’t work
- WP_Query by Category Name
- Ignore a filter on the media library
- Multiple orderby parameters in pre_get_posts() action
- Select posts wich has no relationship in custom taxonomy
- Multiple keyword search
- WP-PageNavi gives me a 404 when using WP Query
- How to wp_query posts with ajax
- post thumb nail
- Filter by title content and meta key at the same time
- What is considered a default query for the request filter?
- How to find exact match for search term in WP_Query? What is the additional string added in LIKE query in WP_Query?
- Two different conditions with a single WP_Query
- Creating query to show which editor (classic or block) was last used to edit a post/page
- Tax query clause inside a meta query clause?
- WordPress search posts by author name with autocomplete
- Meta_query on same meta key, with diffrenct values
- Can we return all category (not post) with Custom Query Filter? [closed]
- WP_Query – Exclude Posts
- Exclude Category filter from Portfolio section
- date_query seems to be ignored by wp_query
- How to pass orderby params to $wpdb->prepare()?
- Get author if post has multiple authors
- how update data through ajax and jquery
- What happens to the default query when I use WP_Query?
- Modifing archive query affects show post count function
- For what queries is conditional tags informative?
- posts archive page – closing WP_Query loop correctly [closed]
- JSON – Create rest api endpoint for Advanced Custom Fields
- Is it possible (and how to) query single Gutenberg blocks?
- Get meta_value of a specific meta_key from all posts belonging to a specific custom type
- Nested array issue in meta_query
- Query by key or author
- Why doesn’t my WP Meta Query return any results?
- How to make the ‘request’ filter work?
- Related categories order posts by category
- Finding post ID dynamically on click
- paginate_links method doesn’t show second page of my custom wp_query
- 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
- Include post_status check within $wpdb query
- Return on a quest all these meta_value
- Complicated WP_Query
- Custom query to show posts
- Taxonomy related query not working
- error with $query->have_posts()
- Multiple Orderby is not working right
- WordPress extremely slow when using get_posts with multiple meta_query relations
- Refresh wp_query with no changes
- SQL query into to WP query
- WordPress WP_Query Search (‘s’) With Multiple Search Terms
- I want to place a post before all others from an ACF boleen field
- Search results stuck on page 1
- How to put posts with some taxonomy on top of others in `pre_get_posts`
- wp_query, calculate with two dates when ‘key’ is text format
- Use value from meta key array for use in WP_Query
- WP_Query sort by ACF date field (newest first) with blank dates first
- Pagination only showed when no category is set in wp_query
- taxonomy-{term}.php terms pagination returning 404 after a certain page
- Using WP Query, I want to include all posts in category 1 as long as they are not also in category 2
- Prevent URL Parameter Affecting other WP Query
- Sort by multiple columns using get_posts
- WP_Query filter Posts by timestamp event (range start and end) and by month (next 12 month)
- WP-Query and Searching Inside Arrays
- Custom WP Query with neither ASC or DESC
- Include custom post type that matches taxonomy field in another custom post type
- Showing all posts of the current custom taxonomy on archive page
- How to choose between hooking into pre_get_posts or into parse_query