Meta query must be done with a nested array. So it may look more like this:
$query = new WP_Query(
array(
'meta_query' => array(
array(
'key' => 'duedate',
'value'=> $today,
'compare' => '>=',
),
),
'paged' => $paged,
'posts_per_page'=>'20'
)
);
Related Posts:
- Custom WP_Query order by post_meta and (author) user_meta
- Add and in the header while looping over custom query in page template
- Transient pagination not working properly
- How to output different posts per page?
- Page navigation doesn’t show when query category
- Create ONE callback for all page templates, post filter queries + paginated pages, triggering pagination via AJAX
- Multisite pagination issue by multi query archive 404
- Yoast primary category query modification
- Notice thrown when creating numeric pagination on custom query
- WP_Query custom order and pagination
- Unable to paginate a custom page query
- I am officially missing something about transient posts
- Pagination of custom page with custom fields query
- Why pagination is not working with tax_query param?
- Custom pagination (Title, date and teaser)
- Pagination is not working on custom query inside a custom home page template
- Horizontally paginate through sets of blog posts?
- Pagination in WP query with transient API
- Pagenavi with archive page
- Search results stuck on page 1
- Pagination when using wp_query?
- Find out total number of pages in global query on archive page?
- WordPress Pagination Not Working – Always Showing First Pages Content
- get_query_var function not working at all
- get_query_var( ‘paged’ ) not working outside of homepage
- Pagination returns 404 after page 20
- Make a WP Query search match exactly the search term
- Query WooCommerce orders where meta data does not exist
- Finding all results from database within 500 miles of the given latitude and longitude [closed]
- Show only oldest post by author
- How to get the posts published in last two days using WP_Query?
- Dynamically Override Fancy Title – Part II
- WP-PageNavi gives me a 404 when using WP Query
- Can not switch the queried post in pre_get_posts hook
- Woocommerce custom loop to show all the products [closed]
- Get the post permalink within the loop but without additional DB query
- Pagination 404 errors for author posts query on author.php
- List the 5 most recent child pages
- Pagination problem after WP_Query with tag filtering
- Pagination stops at page 6
- Paginated HTML Sitemap
- Pagination is broken and I need help fixing it
- Query total number of posts
- Creating a custom search for a specific post type
- WP Pagination on Posts Search Results Page resulting from AJAX WP Query
- Custom query for sidebar isn’t returning results
- paging in WP_Query on static page
- Set conditional on template based on referring page slug
- pagination with numbers for WP_User_Query
- Query posts intersecting tags and categories
- Pagination on static Posts page
- Query Page Content From Theme Options?
- Modify Search Query if original Query gave no results
- How to cache wp_query with pagination using transients?
- Include current post into loop
- Is it possible to query from external database? [duplicate]
- Filter post query to only show direct children of category
- Pagination on template page for custom query redirecting to index.php
- Is it possible to retrieve posts depending on meta_key LIKE condition? [duplicate]
- Paging + WP Query
- WP_User_Query orderby meta_val_num
- Query Not working as expected
- max_num_pages says 4, yet I am only able to navigate to the third page
- Paginate pages with dynamic query
- Trouble Making WP_Query paged
- Multi-layered WP_Query
- `offset` WP_Query argument dont work via `pre_get_posts`
- Function the_posts_pagination() not compatible with WP_Query arguments
- 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
- Query pages created by deleted users
- Exclude post from wp_query based on custom field boolean
- Get posts that match defined arrays of tags
- Order posts by tags count?
- Pagination Shows Up But Won’t Work on Custom Gallery Page
- Strange results from WP_Query
- Is there a way to control both Order By and Order query parameters from one input field
- I need query_posts() to order results first by a meta value and then by post ID
- return child post if available otherwise parent post
- Search has query that will return no results
- WP Query – Search in title or author_name
- URL to Post Archive of Custom Query
- orderby in WP_QUERY – Use the order from the Dashboard
- Random posts in WP_Query when searching by tag
- Pagination returns 404 after page 20
- Ordering Posts by parent category, name ascending
- WP_Query always returning the last custom post
- Query post Pagination Problem
- How to query post into a complex slider
- Combine privileged users array with my current query
- How to organize a WP_Query’s list of posts by category and display category title?
- Need help setting up a search form for wordpress [duplicate]
- Ordering Custom WP_Query loop by meta key value with pagination
- Get WP_Query query after execution?
- Pagination in custom query not working [duplicate]
- paginate_links() on page (shortcode output)
- Pagination showing same posts despite changing page
- Pagination with Custom Post Type not working on index.php: I get a 404
- Pagination on custom post type not working
- Show number of posts AND number on current page (cannot make it work)
- Advanced Search – Is this possible?