Don’t use query_posts this will alter your main loop, you can query posts by day 1-31 using WP-Query();
$day = date('j');
$args = array( 'day' => $day);
$day_query = new WP_Query($args);
if ($day_query->have_posts()) :
while ($day_query->have_posts()) :
$day_query->the_post();
//show posts
endwhile;
wp_reset_postdata();
endif;
Related Posts:
- Is `query_posts` really slower than secondary query?
- Are there any scenarios where the query_posts may be used?
- Why is it necessary to call rewind_posts() when using the loop more than once? [duplicate]
- Multiple posts with one loop iteration
- Post Loop not Returning Permalink
- How to Loop within a Loop (Display Children and then Grandchildren)
- Exclude first 2 posts with meta_key from loop
- Better way to display posts from specific categories, in a grid layout
- popular post weekly and monthly
- 3 Posts in Loop, Show Stickies First
- Query last updated posts (posts updated in the last 24 hours)
- Displaying terms based on loop posts?
- Duplicated posts on category page
- Make blog page show 10 on first page, 9 on every other page
- How to display posts by vote count and if no value continue with latest posts with no votes?
- query_posts() vs get_posts() multiple loops [duplicate]
- Exclude first post (sticky or not) from the loop using query_posts()
- How to order by multiple fields using standard query_posts?
- Pagination not working in category listing [duplicate]
- How can I improve the performance of this query_posts loop?
- Adding div after every two post on main loop! Why will first post not get counted?
- How can I access specific posts brought back by query_posts?
- Separate First Post Loop
- Query posts only with actual text content (not including shortcode or images)
- query_posts clarification needed
- Exclude current post ID from loop in sidepbar.php
- Why does my WP_Query pagination on a custom page.php only loads the homepage?
- Get a Post Loop based on Logged in User information into a Shortcode
- how to add 4 post in one carousel slide
- Query counting excluded category on paged loop
- get_posts and wp_autop (remove filter)
- The Loop isn’t working
- Twitter bootstrap carousel multiple items in carousel
- show posts from one category with comments only
- Least Number of Loops to Create Custom Homepage?
- How to do query_posts on tags pages
- Limitless amount of posts in custom archive page
- How to split a loop into multiple columns
- Is it necessary to reset the query after using get_posts()?
- Using the Loop to show all levels of subpages under a parent page? Halfway there
- Cleanest Way to Select Every Second Element in a Loop?
- Get post by page name or slug
- save_post + insert_post = infinite loop
- Get ID of a page containing secondary loop in content
- ACF Repeater loops and resets – where is the reset_rows() documentation? [closed]
- Why do themes have `while( have_posts() )` in templates like single.php?
- What is best way passing variables to theme templates and using them different places like widgets?
- Apply styling only to first page sticky posts
- Too many nested wp_query loops in this hypothetical query?
- pop-up lighbox with AJAX
- Load comments per post on click with AJAX
- The main Loop is not starting in a custom blog template page
- WordPress Loop – Style rows of posts differently
- How to dynamically build a multiple taxonomy query loop within a post type’s single loop?
- connect last post with first post
- taxonomy tags 404 to custom post types
- Breaking the loop?
- Show a Category X’s custom post type on Category X archive page?
- A smarter way to display multiple loops inside a page template
- How to print out menu names in the foreach loop?
- How do I style the first two posts of a loop
- How to get the role id from the role name?
- How do I paginate a get_posts() request inside another page loop (Paginating childpages)
- How to remove a plugin filter’s priority on specific loops (custom queries)?
- Include current post into loop
- How to create a multidimensional array with multiple loops
- How to make posts unqueryable/unpublish posts where ACF relationship field is an unpublished post? [closed]
- How to create custom popup in shop page on every loop products?
- Show scheduled posts in loop (but don’t link to them)?
- How to get a count of all posts in foreach loop and split into fourths
- Getting posts link in WordPress
- Loop through an array inside a class using foreach [closed]
- using wp_get_attachment_image_src in foreach loop
- How to separate posts loop in to two columns? [duplicate]
- Can’t get the previous and next posts permalink
- Adding first and last classes to three column layout in Bones boilerplate
- Modifying a Loop to Show More
- Does search.php autofilter The Loop?
- Determine if ID is page or post and query the ID
- “the_excerpt” in loop just keeps repeating first post?
- wpdb inside foreach loop only returns first result – 2 other similar cases found [closed]
- Using jQuery .after inside loop
- Calling Posts from Specified Cat
- Add 2 values to post__not_in
- How can I pass additional params to a shortcode while in a loop?
- Add all category as classes in foreach loop
- WordPress For Loop Prints Unwanted Extra Paragraph Element
- How to avoid appending “null” in Ajax?
- Some doubts about how the main query and the custom query works in this custom theme?
- Thumbnail of the latest posts page
- Stuck with conflicting loops on page template
- Change the way wordpress outputs images or image galleries
- Multiple loop for “featured” items returns wrong posts
- How can I access ‘key’ and ‘value’ from an array in a for loop?
- How to get current page id and compare it to looped pages inside the same page?
- Show amount of posts created today above loop?
- How to create WordPress loop with combination of 4 and 2 columns twitter-bootstrap?
- posts_nav_link() not working on index.php
- How to add custom HTML markup and classes to the_content()?
- $do_not_duplicate is not working in genesis theme