This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Reply To: Custom Taxonomies in Post Grid and List Slider

#2992
Jason Bobich
Keymaster

There is a filter there you can mess with. The $args is the array that gets passed to get_posts() for the post list/grid slider.

function my_post_slider_args( $args, $options, $type, $current_location ) {

	// $options -- All options passed from the Builder
	// $type -- "grid" or "list"
	// $current_location -- featured, main, featured_below

	// Do whatever to $args

	return $args;
}
add_filter( 'themeblvd_post_slider_args', 'my_post_slider_args', 10, 4 );

The difficult part is coming up with a way to determine which post list/grid slider you’re filtering based on the variables you have available to you on this filter. One trick might be to incorporate some kind of secret key or word into one of the “query-related” options of the layout builder that you can check for in the $options array. And then since you’re in control of the query you could just make sure that doesn’t get used.

An example might be to set the “Total Number of Posts” option to “my_key” and then look for that in your filter function.

function my_post_slider_args( $args, $options, $type ) {
	if( $type == 'grid' && $options['numberposts'] == 'my_key' ){
		// Do whatever to $args
	}
	return $args;
}
add_filter( 'themeblvd_post_slider_args', 'my_post_slider_args', 10, 3 );