• Resolved krazygyal

    (@krazygyal)


    Hi,

    I am using the widget “Pods – List Items” to display a list of events in the sidebar of website.

    In the custom post type I created with pods that I’m listing, there’s a date custom fields titled “event_date”.

    With the widget option “WHERE”, I would like to filter the events in order to show only events happening after today.

    Is this possible?

    Otherwise, I would like to use the tag “Upcoming” to filter these pods.

    Thanks in advance.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @krazygyal

    Yes you can filter based on date queries.

    Example:

    Upcoming: where="CAST( event_date.metavalue AS DATETIME ) >= NOW()"
    Past: where="CAST( event_date.metavalue AS DATETIME ) < NOW()"

    Cheers, Jory

    Thread Starter krazygyal

    (@krazygyal)

    Thank you very much. The code is just missing an underscore. I have been able to display only upcoming event by adding the following line in the “Where” field:

    CAST( event_date.meta_value AS DATETIME ) >= NOW()
    Plugin Author Jory Hogeveen

    (@keraweb)

    Ah right, sorry about that typo!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Pods – List items published after a specific date’ is closed to new replies.