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
- order by numeric value for meta value
- numberposts? showposts? posts_per_page?
- How to query posts based on lat-lng coordinate as post meta?
- How to query only for products with status “in stock” in WooCommerce? [closed]
- WP_Query displaying ALL posts
- Does WordPress sanitize arguments to WP_Query?
- How to trigger 404 for custom query var?
- get_the_title($postID) OR get_the_title()?
- datetime picker, timestamps and meta queries
- How to order posts in wp_query by a meta_value of the corresponding author
- How to get sum of meta_values of a meta_key in wp_query according to conditions
- How to display 3 different loops in 3 columns on homepage
- Get the post thumbnail with wp_query
- Where to use $post global variable?
- How to display future posts – modified query still yields 404
- Multiple instances of Featured Image Query
- How to apply filter inside a single wp_query?
- Sticky posts are not showing at the top of category posts
- WPDB query – decrypting DB data
- Storing query variable and then using wp_reset_query
- ACF Date Based wp_query
- exclude posts with a specific custom field and value
- Redirect page when URL parameter not set
- Mysql query and order meta value
- Group and list posts by custom taxonomy
- Show scheduled posts in main loop but not in WP_Query?
- WordPress Pagination changes my template
- wp_query ignoring custom post_status
- Query posts(CPT, pages , hierarchical) by Ancestor ID
- Input check to custom post type query
- Get a list of posts with associated meta_value
- Having trouble with WooCommerce Storefront child theme single.php “related posts” modification [closed]
- WordPress pagination not working on template search.php
- Show all data in database table and make it into an interactive table
- How to filter a query by date in a shortcode?
- Search posts missing a particular custom field
- Query post with meta value in set of values
- get_template_part causes 500 error
- Custom post type and standard post not displaying or working
- Sort by presence of thumbnail
- Get posts in taxonomy randomly
- Max Posts and Memory Limit
- WP_Query orderby
- Using Ajax and WP_Query to load more posts on category page fails
- I have problems with the search query using multiple post types
- How to check if logged in user have pending custom post?
- whether a nonce is required for get type and get_query_var?
- How can I re-query post_type and rewrite the url?
- Different query result on local and server
- How can I show only last year posts in wordpress archive?
- Related Post by Tags Code
- I can’t get post based on its postmeta value and key
- Change database image location for transportability
- Combine Tax Archive and Meta_Query in WP_Query
- Get posts by birthday
- How to add in WP_Query to every 3 posts displayed? [duplicate]
- Display three sequential posts on each page load, without repeating previous
- how to avoid reloading/refresh the page when displaying the post of wp_list_categories
- Find by post_meta, then sort by post_meta, then sort by date (wp_posts)
- Optimising amount of calls to custom fields
- Issue in If else condition [closed]
- Pagination not working with WP_QUERY
- Custom Content Slider stop duplicate
- Extract video content from post to display on front page
- Sort Posts with custom meta key by default which is currently set as optional
- wp_query pagination links producing 404
- difference between methods of query
- Related posts with WP_Query
- Carousel slider with WP_Query to show 3 posts on each slide
- how to use transient method?
- WP_Query – meta fields numeric
- How to query posts from single post format on Genesis framework
- How to replecate the _fields parameter in custom REST api endpoint
- How to get all post_id and meta_value using meta_key in wp_postmeta table
- List categories using WP_Query
- WP Query – Show custom posts only if user contain some user meta