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 6860533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:25:13+00:00 2026-05-27T02:25:13+00:00

Need help with a wordpress problem. I need to edit the query.php to ONLY

  • 0

Need help with a wordpress problem.

I need to edit the query.php to ONLY get posts published today OR in the future.
Im getting future post fine by changing:

$where .= " AND ($wpdb->posts.post_status = 'publish'";

to

$where .= " AND ($wpdb->posts.post_status = 'publish' OR";
        $where .= " $wpdb->posts.post_status = 'future'";

But Im still getting old posts

Any ideas?

thanks

EDIT:
I have

iv got in $where .= " AND $wpdb->posts.post_date >= '" . date('Y-m-d') . "' ";

But it doesn seen to effect the results. I have echo’d the $where and the date is showing as 2011-11-22, Does anyone know if this is the correct format?

  • 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-27T02:25:14+00:00Added an answer on May 27, 2026 at 2:25 am

    I’m not very familiar with wordpress but publish would return everything with that status, thus including posts published in the past.

    You should be able to do something like

    $where .= " AND $wpdb->posts.post_status = 'publish'";
    $where .= " AND $wpdb->posts.post_date >= NOW()";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i need some help with a little problem that occurred today. To show the
I need help making a search query for comments (it's for a WordPress site).
I need help getting my head around the difference between my current OOP notion
i need help with disk_total_space function.. i have this on my code <?php $sql=select
I need help with wordpress. I will show a login box on my main
I am using a custom post type in my wordpress theme, and I need
I need to display all my post titles in the sidebar of my Wordpress
Using Wordpress, I need to generate an array of tags(terms) from posts in a
Need help here. i managed to get the drinkName and categories working. http://dl.dropbox.com/u/418769/2.png but
I need some help about mod_rewrite, this is my wordpress address: http://localhost/my_v2010/restaurants?m=display_Add base_url: http://localhost/my_v2010/

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.