My homepage shows about 10-20 post that are manually selected in a slide. I have used Revolution slider. There is a field Specific Posts List field Where I have inserted post Ids 16427,16557,16822,16392,16507 and I want to show them as I have inserted on the field.

I found this Helpful in understanding but I don't want to insert a "order" custom field if possible. Another link made me understand what other option I have however don't understand post__in and menu_order.

Is there a way to show it as my custom list without using custom field?

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.