Support

Account

Home Forums General Issues relationship reverse query and orderby a custom field

Unread

relationship reverse query and orderby a custom field

  • Hi,
    I’m trying to order relationship posts by a custom field.
    I used what I here found about “reverse query”
    http://www.advancedcustomfields.com/resources/tutorials/querying-relationship-fields/

    but I didn’t understand how can I sort them by a custom field inside.

    So, I wrote di $arg

    `$arg = get_posts (array
    (
    ‘meta_query’ => array(
    array(
    ‘key’ => ‘mycustomfield’
    ‘value’ => ‘”‘ . get_the_ID() . ‘”‘,
    ‘compare’ => ‘LIKE’,
    ),
    ),
    )
    );
    `
    I found the right posts.
    I need to sort them by a data picker inside in a foreach function.
    Can you help me please?
    Thanks in advance.

Viewing 1 post (of 1 total)

The topic ‘relationship reverse query and orderby a custom field’ is closed to new replies.