skip to Main Content

Custom Grid Filter Orderby Arguments

The grid filters included with the portfolio grid, staff grid, testimonials grid, post types grid modules in Total, use the core get_terms function in WordPress and it includes a filter "vcex_grid_filter_args" you can use to hook into and alter the arguments via your child theme if you wanted to customize things a bit more. Below is a sample snippet. Of course if you want something very custom you'll want to use this method instead.

/*
 * Alter the Total grid filter arguments
 *
 * @link https://total.wpexplorer.com/docs/snippets/total-grid-filter-orderby-args/
 *
 */
add_filter( 'vcex_grid_filter_args', function( $args ) {
	$args['orderby'] = 'name';
	$args['order']   = 'ASC';
	return $args;
} );
All PHP snippets should be added via child theme's functions.php file or via the Code Snippets Plugin (or alternative plugin)
Back To Top