I don’t think there is a parameter value Today
as you used in date_query
.
If you want to return today’s post then you should provide date value to date_query
as you stored current date in $today
array. So here is your query now.
$today = getdate();
$args = array(
'tag_slug__in' => array( 'destacado'),
'posts_per_page' => 2,
'post_type' => 'any',
'offset' => 3,
'orderby' => 'rand',
'date_query' => array(
array(
'year' => $today['year'],
'month' => $today['mon'],
'day' => $today['mday'],
),
),
'post_status' => 'publish',
);
$featured = new WP_Query($args);
Related Posts:
- WordPress Custom Query to show posts from last x years
- ACF datepicker meta_query Compare Dates in m/d/Y g:i a – Not in Ymd Format
- datetime picker, timestamps and meta queries
- How to get the posts published in last two days using WP_Query?
- List taxonomy terms plus their latest post ordered by post date
- Date query not inclusive despite parameter being true
- Custom Field sort not working (WP 3.8.1)
- Use meta_query to display events by date in custom field
- Query by custom dates in UNIX Time
- How can I create ‘future’ and ‘past’ parameter for restAPI by filtering the CPT custom date field by greater than / less than current datetime?
- 2 weeks ago from meta query meta value
- Posts published last 10 minutes
- Query posts using less than
- WP Query and date format
- Display upcoming events in the next 30 days by querying posts with timestamp in custom meta
- query hook parse_tax_query function takes no effect
- datetime picker, timestamps and meta queries
- Using WP_Query to re-query and sort results using a date?
- WP_Query Sorting Posts by month … timeline effect
- WP_Query filter Posts by timestamp event (range start and end) and by month (next 12 month)
- WP_Query orderby post__in remains ineffective in the Loop [closed]
- WP_QUERY Get posts by category and similar name (Like)
- Using get_posts vs. WP_Query
- How to order posts tag by tag?
- Want to redirect if search query match exact title of any post
- Most commented post should be the first post in the blog
- Perform query with meta_value date
- Custom archive page based on array of categories and tags
- Search another database with wp_query using new wpdb
- Custom page template query_vars
- Compare two meta-fields in a wp_query (where meta-field-A is larger than meta-field-B)
- Different Results with query(‘s=computer’) vs get_posts(‘s=computer’)?
- Why does “Blog pages show at most” interfere with my custom wp_query?
- Recommended way to drop a pending query (in pre_get_posts)?
- WP_Query class not found
- Search – Ajax – Alter Query Parameters with Pagination
- Access to Instance Variables from WP_Query
- WP Query with multiple categories – passing an array works?
- SQL User Query by Multiple Roles using PHP
- how to speed up a complex wp_query?
- Exhausted memory limit with very simple WP_Query
- Select from wp_post and multiple meta_value from wp_postmeta
- Multiple Loops Inside a Function
- Sort users by “birthday” using WP_User_Query
- How to use MySQL’s MATCH AGAINST in WP_Query?
- Ajax Pagination on Ajax filter
- Wp_query returning only one post while query through ajax
- only delete post within query / for each statement (front end)
- How to optimize multiple WP_Query() calls on one page?
- Make a page return false to is_single() and true for is_post_type_archive() before wp_enqueue_scripts
- category query for pages not working
- date_query on draft posts only
- How to get list of posts from permalinks?
- How to change main query to only query posts from a single category? [duplicate]
- wp_query not working with post_type
- how to use pre_gets_posts to exclude one queried ID from homepage loop
- How to check the array values, what WP_Query has brought to me?
- How to Order a list of taxonomies? orderby?
- post_parent don’t work and return 0 page
- date_query in pre_get_posts out of memory
- Combine 2 WP_queries into one (OR relation)
- WP_QUERY wrong ammount of posts
- How to add sort order to incremented and paginated category loop
- How to set parameters for search loop?
- Get posts with no tags?
- get_posts query matches too many results
- Sort by custom field that is an array?
- how to retrieve WP_Query without ordering by date [duplicate]
- Which is from this queries is more faster
- Start Query from 2nd Post without offset
- Related posts by current posts child category
- Trying to change category of wp_query
- Any quicker alternative for WP_Query “NOT IN”
- duplicated posts when using pagination
- meta_query order by date present -> future then show null
- How to upload 3 attachments to current post?
- In a WordPress multisite configuration, how do I instruct WP_Query() to return posts from a sub-site?
- How to query for exact string in custom field?
- Multi line of $wpdb->query just run 1 time and end the loop right after
- Paginated Author.php not using Author.php template
- Help displaying related categories
- A very strange problem with search query
- In Product Category archives how to show Posts having same/similar prod_cat slug structure?
- Custom Theme Building & Permalinks
- wp_query – show pages that have parent defined
- previous_posts_link not working in WordPress pagination
- Eliminate typical pages on search page, turn it into ajax search with “infinite” sized single page
- WP Query to order posts by multiple meta fields
- Display First posts without the default featured image
- paginate_links() with Custom Taxonomy
- Parsing External Table Arguments
- Query posts by meta value and sort by another meta key
- Output ACF field dynamicaly within a taxonomy loop [closed]
- Why does WP_Query not search for two ‘meta_query’ keys separated with OR?
- How do I split a large query with a semi-expensive function included into multiple smaller queries
- Custom WP_query in Jnews theme returns thousands of posts
- 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