Home Forums Add-ons Repeater Field Order custom post by sub custom field values Reply To: Order custom post by sub custom field values

  • Hi @PrIInT

    Thanks for the question.

    Just to clarify this concept. It is not possible to sort posts by a custom field value, where each custom field value has multiple values (multiple rows of data in a repeater field).

    This said, it IS possible to sort the data if you only want to use the ‘first’ row from the repeater field. This means that WP has one meta_value per post and can then sort as per usual!

    at the moment, your orderby meta_key query looks like this:


    All you need to do is construct the exact meta_key which exists in the database. You are extremely close, but need to cahnge the wildcard (%) to 0 to target the first row:


    Hope htat helps.