Custom Fields
Re-Envisioned
Support MB Relationships Order of Relationship

This topic contains 3 replies, has 2 voices, and was last updated by  Anh Tran 2 months, 1 week ago.

  • Creator
    Topic
  • #14484
    Resolved
    Matthias Nettekoven
    Participant

    When ordering the relationship, the order_from / order_to only reflects the order on the Admin Side but not on the Front.

    $args = array(
                'post_type' => 'staff-member',
                'post_status' => 'publish',
                'relationship' => array(
                    'id' => $relation,
                    'to' => get_the_ID()
                ),
    
            );

    How can I access the order I used on the admin side?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #14490

    Matthias Nettekoven
    Participant

    Anyone? The args above are referring to a default WP Query.

    #14493

    Matthias Nettekoven
    Participant

    Nevermind, the code part I used was using get posts which does not seem to work for the order. I switched over to WP Query. Any reason why the order does not work for get posts? The relationship query works as intended but not the order.

    #14494

    Anh Tran
    Keymaster

    Hi Matthias,

    Using get_posts is risky, since it auto applies suppress_filters=true, which is used to filter the results (the extension changes the query by applying new WHERE, JOIN clauses). If you want to make it work like WP_Query, I think you need to set it to false.

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

You must be logged in to reply to this topic.