Try this
static function loop_args($parent_id, $number) {
$today = getdate();
$args = [
'cat' => $parent_id,
'showposts' => '7',
'orderby' => 'ID',
'order' => 'asc',
'date_query' => array(
array(
'year' => $today["year"],
'month' => $today["mon"],
'day' => $today["mday"],
),
),
];
return $args;
}
Related Posts:
- Inject post (from specific category) between posts in Loop
- Count number of published posts by type
- Get taxonomy terms only of the WP_Query current posts
- Hide post if matches current month and year
- How can I use wp_query to show all product data using just the products ID?
- How to store post ID’s in cookie or session to display the same posts later
- WP_Query: getting posts where custom field exists
- Array to string conversion on array_map
- Store metakey value as an array
- Increment paged on WP_Query
- Modify main query before it run without pre_get_post
- Do not duplicate posts with multiple categories in multiple loops
- array_rand not working correctly?
- WP_Query() load selected post
- Wp Query : Order by distance lat,lon
- WordPress sorting posts by date and title using a dropdown
- posts_per_page displays only 2 posts instead of 4 posts
- Query on a repeater date (acf)
- Check the database for a postmeta field
- Getting info about selected posts using one WP_Query
- How to display last whole post on the homepage
- Only Get A Certain Number of Posts From WP_Query
- insert thumbnail image from php script
- Weird Behaviour: Not all WordPress Posts appearing
- List of child pages fetch next results at link click
- Query category-specific, paginated posts and allow viewer to change sort order
- Why does WP_Query show only the same post even with different categories and endwhile?
- How to modify this function to exclude also the post belonging to a specific category?
- How to use a conditional statement in a post loop but not count towards the “posts_per_page” if false
- Query multiple custom post types in single loop
- Build a content and excerpt grid loop with paging and options for # of posts
- Display posts by month
- Custom SQL query to get List of posts with featured image url
- wp_delete_post deletes all posts instead of just expired ones
- Get only modified posts
- Trim first 2 words of the exceprt
- How is WordPress manipulating the posts like there are folders?
- Get the last month with posts using a recursive function…
- How to query for pages/post depending on slug?
- How do I “get the next 10 posts after post_id == x”?
- Recent Posts slider, using WP_Query(), loads duplicate sliders
- Why WP_Query(‘showposts=5’) shows only 1 post?
- How to use $query->set with post__in?
- Display a specific category of products in shop page and disable code for specific actions
- Which hook/action will help me solve my problem?
- Custom query, checking values of multiple meta keys
- Get children post mime type using parent post_ID wp_post
- wp_query get the 2nd post
- Count posts on multisite with blog id
- Making (and edit existing) posts with ID included
- Parsing Menu Items and Blog Posts
- How to add div blocks after certain set of post
- How to show an entire post content and not also the excerpt?
- Convert a string into a decimal number for use in query
- Hide posts if user is added to it WP_query
- How to insert wp_users ->user login name to wp_terms when a new user registering?
- Order BY Most Liked And Published Between Previous Week Monday And Next Week Monday
- .html end of URl affected to SEO?
- Sort posts in a specific way
- Update if post with specific title exists
- posts_nav_link pulling in multiple post types
- Modifying WP URL handing code?
- Free search and custom taxonomy query not providing the same result
- How do I reset $wp_query in a function?
- Advanced Query posts
- Replace a single variable with add_filter
- Sending simple variable on single page to WP JSON
- My Custom Post Type AJAX Query is Returning no posts – why?
- How to exclude meta no index pages from wp_list_pages
- meta_query search names when they have middle initials
- Inside Array – “unidentified index” error with “prepare was called incorrectly” despite not calling the prepared statement with wordpress [closed]
- Don’t update modified post date when user add a product review or comment?
- Limit the number of characters/words in an excerpt for a related posts section
- get_filtered_term_product_counts – Get product terms if any products
- Search for single post by 2 tags
- How to center all text body in single.php at once?
- Woocommerce Related Product by 2 taxonomy
- Get current_post in reverse order with pagination
- How do I get the featured post to share on Social Media and show on Individual Post pages?
- Basic PHP question (displaying post title over thumbnail) [closed]
- Can’t get data from audio media
- WP_Query count of different meta key values [duplicate]
- Post from front end form to post_meta
- media_handle_sideload() returned post_id being incremented
- Saving Post redirects to 404 page when php $_GET variable in post body
- How can I add WordPress Audio Player as featured audio in Audio Blog Posts?
- Fix incorrect related posts code snippet
- How to customize posts in WordPress by using HTML and CSS?
- wp_query on search results page showing all results every time
- foreach all the post
- Blog Posts not sorted and pagination not adjusted after filtering some category
- How do I run the following script from my articles page?
- How to create a WordPress PAGE in another folder?
- Execute multiple PHP Snippets causes error?
- How do I get a function to work in single.php
- Three different queries on same page
- Count the number of matching post names in foreach loop
- Need Help With Making Full-Width Template for Blog Posts (common methods aren’t working)
- External WP_Query call from PHP crashed after version update
- WordPress Query with meta_key and order by another meta_key