Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter xxhann

    (@xxhann)

    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:

    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;
    }
    
    Thread Starter xxhann

    (@xxhann)

    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)

    This seems to be the code that being used to set the order if this helps

    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 11 months, 2 weeks ago by xxhann.
Viewing 2 replies - 1 through 2 (of 2 total)