Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6752289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:01:38+00:00 2026-05-26T13:01:38+00:00

I am attempting to grab all posts for a specific day (ie: today), however

  • 0

I am attempting to grab all posts for a specific day (ie: today), however for some reason it is only returning the one.

$wp_posts = query_posts(array(
            'cat' => 4,
            'post_status' => array('any', 'publish', 'future', 'inherit', 'revision', 'pending'), 
            'year' => '2011',
            'monthnum' => '10',
            'day' => '25',                  
            'order_by' => 'post_date',
            'order' => 'ASC'
            ));

This should post all the posts for today under a category, but whatever reason it only outputs 1 post and I do not know why.

At first I thought it might be a permalink issue, but I removed the permalinks and its still only returning the one post?

On my localhost the code works fine and outputs all the content required for a specific day.

Additionally, I have checked the database and all the posts for the day are there and appear to be in schedule or posted status.

So there is no reason why the query_posts should be returning just 1 item.

I want to output the last query used by query_posts to investigate what is causing the problem.

How do I verbosely output the last query as used by query_posts?

Thanks.

Edit.

I will accept an answer that converts the above to a verbose SQL query which I can run to see what is going on

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:01:38+00:00Added an answer on May 26, 2026 at 1:01 pm

    Take a look at http://codex.wordpress.org/Editing_wp-config.php#Save_queries_for_analysis (please make sure you take note of the warning to not do this on a production site).

    The solution is that you probably need to set the posts_per_page value in your arguments array to -1.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to use wget to recursively grab only the .jpg files from a
I am attempting to grab frames and preview the video from a Bodelin Proscope
Using php coding, I'm attempting to make a script which will grab content from
I'm attempting to mangle a SQL query via regex. My goal is essentially grab
What I'm attempting to do is create a simple Quote of the Day script.
I am attempting to grab revenue from a website past a login page through
I'm attempting to replace all <foo> elements in a DOMDocument with <bar> elements. The
Attempting to do TDD, I often need to execute all my tests - in
I'm attempting to grab a text file from a folder for conversion to .xls
I am creating an HttpListener by attempting to grab a random port that is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.