Support

Account

Home Forums Front-end Issues wp_query Orderby multiple meta doesnt work Reply To: wp_query Orderby multiple meta doesnt work

  • Sorry for the long wait.. tried this code but doesnt work correctly.

    The “activi_datum” is empty for the post that doesnt have “activi_datumperiode” enabled. Its a conditional field.

    If “activi_datumperiode” turned on == enable “activi_datum” field.
    If “activi_datumperiode” turned off == enable “free text” field.

    What your code outputs is an ASC date list without the posts without a date.
    Simply changing the relation “AND” in “OR” fixes the issue only orderby Date doenst work anymore.

    22-03-2023
    22-02-2023
    28-03-2023
    28-06-2023
    11-05-2023
    Every monday
    Every Sunday

    Looks like it orders by “activi_datumperiode” and then by post creation date