function modify_slider_order($query, $slider_id) {
if($slider_id == 4) {
// $ids=[16427,16557,16822,16507,16392,16548,16564,16426,16412,16404,16419,16421];
$query['orderby'] = 'post__in';
// $query['orderby'] = array (
// 'post__in' => $ids,
// 'orderby' => 'post__in',
// 'order' => 'ASC'
// );
}
return $query;
}
add_filter('revslider_get_posts', 'modify_slider_order', 10, 2);
This solved my problem, I’m not sure why I don’t even have to pass IDs but this worked.
Related Posts:
- Order By table field comment_status in WordPress > 4.0
- Orderby two meta fields not working
- Nested meta_query with multiple relation keys
- numberposts? showposts? posts_per_page?
- Ignoring initial articles (like ‘a’, ‘an’ or ‘the’) when sorting queries?
- WP_Query orderby post__in remains ineffective in the Loop [closed]
- WP_Query orderby date not working
- Order by optional meta key?
- Sorting: custom query with orderby meta_value_num THEN by title
- Order by DESC, ASC in custom WP_Query
- WP_Query order by multiple meta keys & fields
- Secondary Sort (fallback) for WP_Query
- Query Posts in a Predefined Order
- How to get order of posts?
- Order posts by ID in the given order
- Custom WP_Query order by post_meta and (author) user_meta
- Sorting posts by custom date fields (non standard date format)
- How can I save an array from a random post sequence for later use?
- How to order posts tag by tag?
- How do I order pages and categories by ID or name in the same query?
- All-in-One Event Calendar: Custom Query – Getting each event Instance [closed]
- Is there an action/filter called when WP_Query->query is finished and assigns posts
- WP_Query ordered by custom field that is a date string?
- WP_Query sort by comment meta data
- Limit search results to exact match
- Order posts by tags count?
- Merge 2 args in one WP_Query and order it by date
- Orderby = none not working [duplicate]
- Highlighting Sub topic in a post?
- WP_query ‘orderby=none’ Problem
- Order posts by date and then by custom field
- How to order a post type with meta_value_num and if meta_value_num does not exist then order by date
- Pagination Not working on Home Page with 2 Query
- Revolution Slider Orderby Two Custom Fields
- Multiple keyword search
- Order posts ascending with number in title
- List taxonomy terms plus their latest post ordered by post date
- Get number of comments after modifying comment query
- Order by the results of a function with WP_query
- Show default content if custom WP_Query has no posts
- How to order posts in wp_query by a meta_value of the corresponding author
- Order by menu structure
- WP_Query order by date in meta_value
- How to use order RAND() on WordPress?
- Show all parents and children in custom post type in right order
- Ordering by meta_value AND date NOT WORKING with wp_query
- WP_Query orderby breaks when using AJAX?
- Include Sticky Posts with Custom Query
- Order WP Query posts by custom order calculated from post meta values
- $wpdb->insert inserting two rows in database
- Custom Post order for homepage
- Meta query with order by another custom field
- Change default ordering of taxonomy terms – pre_get_terms
- WordPress WP_Query orderby being overwritten
- WP_Query Order by Specific Post ID First
- Order Posts by meta value AND published date
- How can I pick a single post from the latest 3?
- Wp query orderby ‘title’ doesn’t work
- How can I order Wp_Query hierarchically?
- How do I sort posts with multiple pages
- Sorting posts DESC based on the number of comments using WP_Query
- Create unique page without header.php for json feed
- Order WP_Query by multiple fields, subtracting them from one another
- Complex Orderby Parameters: How to query with multiple orderby parameters using meta_value_num?
- pre_get_posts order by not working
- Sub-loop / nested loops Best Practices
- How to loop for every result found in the_content() when using the search query?
- (Solved) WP_Query ($ args) -> How to sort letters and numbers within the same array
- Orderby ASC changes to DESC in WP_Query
- Is there any advantage of using default WordPress Search instead of creating a custom one?
- SQL: What is wrong with the following query (generated by WordPress WP_Query, ordering prices)
- Clean up WordPress code that repeats
- Complex WP_Query order request: DESC by day, but then ASC by time
- How to set multiple `orderby` in query argument?
- WP_Query order result by date AND meta_value
- How to optimize multiple WP_Query() calls on one page?
- Use post object from first query in second query
- Order by title without taking into account ‘the’
- WP_Query orderby author__in
- How to orderby multiple meta fields if some fields are empty
- Sort wordpress custom posts based on meta value
- WP_Query: Group events by year, sorted DESC; then by date for each year group, sorted ASC
- Weird orderby => post__in issue
- Query to get siblings and parent page
- Order by summing multiple values
- Understanding the orderby in WP_Query?
- How to list custom fields as headers and list all pages sharing that custom field under it?
- Order by empty custom field
- Cutom wp_query for geolocation search, pagination not working
- How to order posts by title after they have already been sorted by category
- Advanced ordering of query_posts
- Help ordering Post loop by two meta values
- Order ascending is ignored in meta query?
- meta_value_num not ordering all items
- Include data from custom table in WP_Query
- echo a specific meta_key queried through a custom post
- How to filter a query by multiple meta keys and order by other meta keys
- Multiple Orderby’s using random order WP_Query
- WP Group posts by year(desc) > month(desc) > date(asc)
- Debugging wp_query orderby for taxonomy