Using wp_query to get specific scheduled posts
-
Hi
I’m helping with some work on a site. They schedule a special type of post to appear on “today’s date”. They usually enter in a full months worth of posts (they are scheduled for each day of the week at 00:01 of that day). I’ve written some php code that uses the wp_query to return the post of that day.
It’s kinda working.
But the main person of the site noticed that “tomorrow’s” post usually appears around 10pm “today” instead of 1 minute after midnight of that day.
I’m using ShortCode Exec PHP to create php snippets to use in a page.
You can view the code snippet here: https://pastebin.com/PrCTy6fbBlog settings are set with the correct time zone.
When I look at the initial date returned from current_time(‘sql’) it returns the correct “local” date.
But wp_query seems to be thinking its already “tomorrow” and returning the following day’s post.
- The topic ‘Using wp_query to get specific scheduled posts’ is closed to new replies.