You can try the following to query for last hour posts:
'date_query' => [
[
'after' => '1 hour ago',
'inclusive' => true,
],
],
or
'date_query' => [
[
'after' => 'last hour',
'inclusive' => true,
],
],
or
'date_query' => [
[
'after' => '-1 hour',
'inclusive' => true,
],
],
Here we are playing with the strtotime() support in date_query.
Related Posts:
- Random sort within an already sorted query
- Displaying the category name of a custom post type
- Search by Hyphen
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- How do I reorder (pop and push) items from WP_Query?
- How to exclude latest x posts from a paginated query?
- Reverse chronology of post listing
- WP_Query to work with custom view
- WordPress Number of Posts Not Changing With posts_per_page
- How to add posts to wp_query result?
- Posts for next month
- Exclude posts with specific meta_value while sorting by a separate meta_value
- WP_Query only ONE post, won’t work
- Unable to modify(update) posts – Page not found
- Custom Order in WP Query
- Fetch posts from current week (Sunday to Saturday)
- Search query – exact post title match
- Converting multiple loops into one single loop with pagination
- How would I get 1 latest post from a query for 5 posts?
- How to get most recent commented post above new submitted post in WordPress?
- How to start with post number x?
- Exclude posts with empty post_content in wp_query
- Exclude posts from featuring
- Lazy Load using WP_Query pagination
- Only display a certain number of posts, dependent on how many posts there are available in a query
- AJAX filter posts by year
- Automatic post deletion
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- Yearly archive page for future year
- I want to get title name of post, but i didn’t get by this code. Any suggestion?
- How can I show many posts an author has per week?
- Ajax load more button in Recent posts widget
- WP_Query orderby not working with meta_value_num and menu_order
- Custom WP_Query with complex ‘post_status’ argument
- is there a way to show the the post title after the image?
- How do I correctly set up a WP-Query to only show upcoming event-posts?
- Blog post per page setting conflicting with custom WP_Query?
- How to exclude latest x posts from a paginated query?
- Pausing and Resuming WP_Query results
- Select only post id and meta value with WP_Query
- How to : pagination in 3 different custom loops on the same page
- Query Posts With Over 1000 Views
- Adding a blog archive with pagination using WP_Query
- How to get Tags with specific post id
- How do I extract just the post ID of the first item in whatever WP_Query returns?
- Show post content and title in diferent divs using WP_Query using a loop
- Show posts by author of membership level (Paid Membership Pro)
- How to get posts published on the latest date?
- Why posts array is empty?
- Page and post loop same template
- How to check in functions.php if there is data in a WP_Query?
- How can I insert a new markup element after 4 posts automatically? [closed]
- If no posts exist for current day and month, show the next available day of posts
- Related Posts function not working
- how to handle the loop using filling bootstrap grid structure?
- wp_query if have posts show date but not in loop
- Query function not executed between element [closed]
- Custom WP_Query not working correctly
- Echo the number of posts being displayed
- Creating a related posts section in wordpress inside a default post
- How to display WP Query filters?
- Finding a post’s slug
- Is there a function to get post info for any publish_status by post ID?
- How Can I Always Display A Particular Post First Using WP_Query?
- Optimal WP Web App Backend for mobile app development
- How do I display main query posts in random order using add_filter
- Why sorting posts doesn’t work properly?
- the wp_post_update isn’t working all the time
- Display specific posts based on an ID of another post
- query posts with selected post ids first
- Change URL of previous posts and next posts link in WordPress
- How to invoke a HTML custom button based on a HTML dropdownlist menu
- Order posts inside bootstrap card columns
- long-title posts do not want published
- How to get value of a selected option from select tag and use it in WP_query to filter posts?
- Counting Posts by Category
- show image gallery in archives or category page
- Page with Category Returning 1
- wp_query args with relation
- WP_Query sort by meta_value_num or date
- Get 5 most recent categories
- Creating Ordered Query using Meta_key
- WP Query between posts custom fields [duplicate]
- Retrieve latest post by multiple categories with ID
- Update Post with Modified Data
- Can’t get pagination to work
- How to Include a common category in a custom Category Search
- wp_query select if have comments
- wp_query posts sorting doesn’t work
- Order by ‘s’ using WP_Query()
- custom sort posts in archive/taxanomy page
- how to print loops for odd in 1st column and even in 2nd column in wordpress [closed]
- Trying to create shortcode listing custom posts, but formating not being included
- Show Title/Date/Excerpt of first post & only Title for rest in Query [duplicate]
- Get posts after calculating meta key
- Next and Previous buttons are not showing on home page for post
- How edit footer copyright info? [closed]
- Get related posts matching most of the provided tags using WP_Query
- WP_Query post_tilte search in posts table
- Is it possible to use the_post 2 times in one loop