diff --git a/includes/api/ram-rest-posts-controller.php b/includes/api/ram-rest-posts-controller.php index 12fc460ad4567ba69d84b7cb2c9e8d8b5494abbb..e5ee51bca16a109e7585045739cac399a4ec20a9 100644 --- a/includes/api/ram-rest-posts-controller.php +++ b/includes/api/ram-rest-posts-controller.php @@ -535,7 +535,7 @@ class RAM_REST_Posts_Controller extends WP_REST_Controller{ $posts =array(); if(!empty($postSwipeIDs)) { - $sql="SELECT * from ".$wpdb->posts." where id in(".$postSwipeIDs.")"; + $sql="SELECT * from ".$wpdb->posts." where id in(".$postSwipeIDs.") ORDER BY find_in_set(id,'".$postSwipeIDs."')"; $_posts = $wpdb->get_results($sql); foreach ($_posts as $post) {