Support » Fixing WordPress » Display posts based on Custom Field Date entry

  • I am trying to create a loop where I display posts based on a date entry in a custom field. I want to display all posts that occur after today’s date (as defined in the custom field). I have the following code in place but it doesn’t seem to be working.

    I have made sure that the date format in the custom field is the same as I have the current date as stated in the code.

    The problem is, it is displaying EVERY post in my category instead of only the ones that occur in the future (based on custom field).

    This site is on a private server and is not accessible from outside our network.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Ok, I think I figured out my issue…

    My Calendar picker for the custom field puts the date in the format mm/dd/yyyy and when comparing todays date in that format, it uses the month first to determine > or not.

    Is there a way to change the format of what is read in the DB to yyyy/mm/dd for comparison sakes?

    Does that make sense?

    Any luck with this? I need to change our Archive widget to show archives based upon a custom date field. Looks like a similar project that you have here. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display posts based on Custom Field Date entry’ is closed to new replies.