Yes, it is possible. You can pass full date as before and after params, so:
$given_date_as_time = strtotime('2017-11-22 00:00:00');
$args = array(
'post_type' => 'post',
'date_query' => array(
'before' => date( 'c', $given_date_as_time ),
'after' => date('c', strtotime( '- 10 days', $given_date_as_time ) ),
),
);
$query = new WP_Query( $args );
above query is also correct and will give you result you wanted.
Related Posts:
- How to give classname to post if post has no content?
- How to show related posts by category
- How to exclude latest x posts from a paginated query?
- How to know if get_posts() failed?
- How to display posts by current user/author in a custom page template?
- Query posts distinct authors
- Query only Posts from Both of Two Category?
- WordPress get posts by date without query_posts
- Quickest way to get last or oldest post date – WP Query
- Hiding posts in a list from specified categories
- How would I get 1 latest post from a query for 5 posts?
- Can I set and show “important” post in my blog?
- Exclude posts with empty post_content in wp_query
- Improving WP_Query for performance when random posts are ordered
- Reset Popular post query?
- Inserting custom data to the_post() during loop
- Why WP_Query(‘showposts=5’) shows only 1 post?
- is there a way to show the the post title after the image?
- Why is querying posts messing up my pages?
- Blog post per page setting conflicting with custom WP_Query?
- How to exclude latest x posts from a paginated query?
- Random ajax load only works with posts_per_page set to -1
- posts_per_page option limits the number of Gallery items
- wp_posts table: safely remove unused columns to save database storage
- Query Posts by Custom Field
- How to get posts from a current post’s month?
- Nested WP_Query breaking loop
- WordPress query_posts by tag doesn’t work anymore(?)
- While loop articles – if statement order
- why the same code got different results when using query_posts in functions.php and index.php
- Display Posts with template on a Page
- Query for first 3 posts to change the look and feel
- How to get posts published on the latest date?
- Why posts array is empty?
- How to check in functions.php if there is data in a WP_Query?
- Shortcode with ‘year’ parameter
- Post Filtering by GET URL parameters
- On what hook can I get the queried object’s final state?
- wp_query with ajax
- WP_Query: Show 10 posts in date order, first three random
- Random posts that always include a particular post?
- Related Posts function not working
- WordPress post filter menu
- Query function not executed between element [closed]
- Echo the number of posts being displayed
- WordPress query portfolio posts
- Display 3 posts with different HTML markup using a loop
- Get posts from current category?
- Change content off every sixth element
- How to show multiple posts thumbnail, title and date in widget
- How to merge the content of posts that have the same title?
- get posts, run a custom query, and join the results
- Show posts from two specific category in WP_Query
- How to create loop of posts except post ID defined via ACF field
- Displaying all posts from other sites on the network on one site
- Multisite how to display merged posts from two sites and sort by latest date?
- Fill the exclude array() in get_posts()
- Show 5 posts and than 3 posts offset with pagination
- wp_query args with relation
- WP_Query to get posts in a specific tag or has post_format
- Manipulate query to show specific post
- Sort / Filter Queries
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- Why I have this strange behavior when I try to exlude the featured post from posts visualization?
- How do I control the fallback query after the original query returned cero posts?
- Remove duplicated posts in the loop if post has more than one category
- Retrieve latest post by multiple categories with ID
- Adding a category at even positions on main loop with modified pagination
- How to get all post titles starting with numbers and symbols?
- wp_query select if have comments
- How to get single post by one author?
- posts_per_page – Repeats only first posts ‘post__in’ array
- query_posts different amount of posts per page [duplicate]
- Word count for all posts of all authors
- How to show related posts by detecting the current category?
- When should you use WP_Query vs query_posts() vs get_posts()?
- How to pass multiple checkbox values to wordpress query?
- Pagination for custom query won’t let me back on page 1
- Order posts by separate menu order for different sub-categories
- Query Posts From Multiple Post Types
- Displaying Results From Custom Taxonomy Query
- How to limit the number of results for all query_posts on mysite
- External link not showing on post but showing on comment
- Make assigning post to a specific category equivalent to assigning it to all categories
- Update Post with Modified Data
- Multiple loops on a Search result page?
- How do I paginate posts page with $wpdb?
- Can’t get pagination to work
- WP_Query retrieve custom posts but not the post showing
- How to Include a common category in a custom Category Search
- Why I getting only 1 post?
- How to inject a post within a loop
- WordPress ultra slow if I click on posts?
- Bulk Attach Or Insert Media To Post Without Opening Post Editor
- How to get alphabetic listing x other posts, based on first letter post?
- The next_posts_link() works only with original $wp_query
- What is wrong with this wp_query?
- WP_Query: Fetch posts that are in (category1 and not in category2), OR posts that are not in cagegory1
- Creating pages and getting their values from the database table
- WP_Query based on a custom field result