Skip to content

Ordering by connection not working #8

Description

@jeffstieler

It appears that letting O2O form the query for ordering by connection sort is no longer working.

The find_in_set used in the SQL doesn't return the posts in the correct order.

Example query generated by O2O: SELECT wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.ID IN (338,249,243) AND wp_posts.post_type = 'post' AND ((wp_posts.post_status = 'publish')) ORDER BY find_in_set(wp_posts.ID, '338, 249, 243') ASC LIMIT 0, 9

This resulted in an order of 243, 249, 338.

The actual connection order can be queried by relying on 'orderby' => 'post__in' - so that might be a possible solution.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions