• Resolved pmarques75

    (@pmarques75)


    Hi,
    I have a POD created with two date fields (applications_start and applications_end) and I want to display the entries that have applications open at the moment. First, I am unable to display even when I use a simple condition like
    where="CAST(applications_end.meta_value as DATE) BETWEEN CURDATE() and '2020/12/31'"
    EDIT: I removed the .meta_value and it now works – but I don’t know if this is a correct procedure.

    I am still unable to display only the entries who are in the applications_start > CURDATE() < applications_end range. Any tips?

    Thanks in advance,

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

    (@keraweb)

    Hi @pmarques75

    In any case your date format is incorrect. This should be YYYY-MM-DD (dashes instead of slashes).

    I believe for ranges you should use two meta values in that where parameter. So CAST(date_from as DATE) BETWEEN CURDATE() and CAST(date_to as DATE).

    Cheers, Jory

    Thread Starter pmarques75

    (@pmarques75)

    Hi @keraweb

    Thank you for your reply. I was able to get there – but what I don’t understand is why I had to delete “.meta_value” from the query – DIVI even refused to save the changes. Once I removed that, it worked. Anyway, it’s solved!

    Thank you so much,
    Pedro

    Plugin Author Jory Hogeveen

    (@keraweb)

    You’re welcome! The best way to say thanks is to leave a 5 star review at https://ww.wp.xz.cn/plugins/pods/ and (if you’re feeling especially generous) become a Friend of Pods at https://friends.pods.io/

    Also, keep in mind that Divi does not have any compatibility with custom meta fields, only plain fields. So long you work with shortcodes you should be fine though.

    Cheers, Jory

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Pods Shortcode: display pods within specific dates’ is closed to new replies.