• SadieG

    (@sadieg)


    We’d previous had an issue with the Post Types Order plugin altering the order of our Event Calendar posts. It was recommended to try the code from this page:

    https://www.nsp-code.com/ignore-sort-apply-for-certain-query-on-post-types-order/

    It did the trick for awhile. Our Featured Slider posts were able to be reordered by drag and drop and our Event Calendar posts were in their proper order. However, now there’s a conflict. If I use the “ignore” code to exclude the Event Calendar posts (the post type is tribe_events), the drag and drop sorting no longer works for the Featured posts. If the code is removed, the drag and drop works fine but the Event Calendar events show out of order.

    This is the code I used:

    add_filter(‘pto/posts_orderby’, ‘theme_pto_posts_orderby’, 10, 2);
    function theme_pto_posts_orderby($orderBy, $query)
    {
    if( (! is_array($query->query_vars[‘post_type’]) && $query->query_vars[‘post_type’] = ‘tribe_events’) ||
    (is_array($query->query_vars) && in_array(‘tribe_events’, $query->query_vars)))
    return FALSE;

    return $orderBy;
    }

    I placed it in the functions.php file.

    Please note, I’m conversant with CSS and HTML but not so much with PHP.

    Thanks in advance.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author nsp-code

    (@nsp-code)

    Hi,
    You said “the drag and drop sorting no longer works” where exactly within Re-Order interface or default WordPress archive page?

    Thanks

    Thread Starter SadieG

    (@sadieg)

    It’s not working on either. I can drag and reorder items, then save (on the Re-Order Interface), but everything shows up on the front end in the old order.

    dgfrench

    (@dgfrench)

    I’m having the same issue so I’m wondering if The Events Calendar update broke this?

    Thread Starter SadieG

    (@sadieg)

    Bump.

    Any new developments on this @sadieg ?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Sort No Longer Working’ is closed to new replies.