Skip to content

Snippet: 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 a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top