Title: Filtered posts
Last modified: December 14, 2023

---

# Filtered posts

 *  [xxhann](https://wordpress.org/support/users/xxhann/)
 * (@xxhann)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/filtered-posts-2/)
 * I’m using a plugin to display team members (GS Team) – ReOrder plugin works great
   to reorder the team members in here when using a standard grid layout, however
   when I change the layout to have a filter then it loses all the order and reverts
   back to the previous order.
   How can I get this to work when a filter is being
   used?

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/filtered-posts-2/#post-17279887)
 * > How can I get this to work when a filter is being used?
 * can you explain you mean by a filter? Does it uses hooks to implement the results?
   What about the actual post query, how is that handled?
 *  Thread Starter [xxhann](https://wordpress.org/support/users/xxhann/)
 * (@xxhann)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/filtered-posts-2/#post-17280177)
 * So here is the filter i’m using which is breaking the posts up into categories
   just to give an idea of the filter see image ([https://tinypic.host/image/bAWx5](https://tinypic.host/image/bAWx5))
 * This seems to be the code that being used to set the order if this helps
 *     ```wp-block-code
       function get_query($atts) {
   
           $args = shortcode_atts([
               'order'                => 'DESC',
               'orderby'            => 'date',
               'posts_per_page'    => -1,
               'paged'             => 1,
               'tax_query'         => [],
           ], $atts);
   
           $args['post_type'] = 'gs_team';
   
           return new \WP_Query(apply_filters('gs_team_wp_query_args', $args));
       }
       ```
   
    -  This reply was modified 2 years, 5 months ago by [xxhann](https://wordpress.org/support/users/xxhann/).
 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/filtered-posts-2/#post-17280387)
 * you’re using an `'orderby'` directive. The plugin will no rank your posts unless
   you’re overriding the oderby which you can either check in the ReOrder page or
   programmatically set with a filter, see [faq](https://wordpress.org/plugins/reorder-post-within-categories/#faq)#
   10 section 2
 *  Thread Starter [xxhann](https://wordpress.org/support/users/xxhann/)
 * (@xxhann)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/filtered-posts-2/#post-17280432)
 * Thanks, but I have been playing around with this and it’s not seeming to make
   any difference. This is what i’ve currently got:
 *     ```wp-block-code
       add_filter('rpwc2_allow_custom_sort_orderby_override', 'override_orderby_sorting', 10, 5);
   
       function override_orderby_sorting($override, $wp_query, $taxonomy, $term_id, $type) {
   
           if ($wp_query->get('post_type') === 'gs_team' && $wp_query->is_main_query()) {
               $override = true;
           }
           return $override;
       }
       ```
   
 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/filtered-posts-2/#post-17280437)
 * is the line
 *     ```wp-block-code
       $override = true;
       ```
   
 * actually being executed? I am not sure `$wp_query->is_main_query()` will be true
   for your custom query
 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/filtered-posts-2/#post-17280450)
 * also, is the filter `'gs_team_wp_query_args'` being used by a function? If so
   what other args are passed into the query? You should make sure `suppress_filters`
   is set to false, it is by default, but if a plugin/function sets it to true then
   the reorder plugin functionality will never be invoked.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Filtered posts’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/reorder-post-within-categories_c18d38.
   svg)
 * [ReOrder Posts within Categories](https://wordpress.org/plugins/reorder-post-within-categories/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/reorder-post-within-categories/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/reorder-post-within-categories/)
 * [Active Topics](https://wordpress.org/support/plugin/reorder-post-within-categories/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/reorder-post-within-categories/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/reorder-post-within-categories/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * Last activity: [2 years, 5 months ago](https://wordpress.org/support/topic/filtered-posts-2/#post-17280450)
 * Status: not resolved