Support

Account

Home Forums ACF PRO Get Next Post Reply To: Get Next Post

  • The next event from the current event shown, or the next event in general?

    For example:
    1) you’re showing event A and the next one after this event is event B
    2) today is Nov 18 and the next event in Nov 20

    And now that I understand that you’re trying to query a sub field of a flexible content field, that just makes things more difficult. You can’t just query sub fields.

    Let’s say that the value you want is in the first row of the repeater or flex field, the actual meta key will be “repeater_field_name_0_event_date” or “flex_field_name_0_event_date” where the “0” represents the row number starting at zero.

    There is a section on this page that explains it https://www.advancedcustomfields.com/resources/query-posts-custom-fields/ and there are many topics here that talk about it. I will not be able to help you with this, because I avoid querying sub fields at all costs, it involves a ridiculous amount of work and testing to get it right that will constantly be breaking or need tweaking to keep it working.

    answer my first question and I’ll see if I can think of a work around for querying sub fields for what you want to do.