Skip to content

Instantly share code, notes, and snippets.

@themeblvd
Created May 20, 2017 20:42
Show Gist options
  • Save themeblvd/a4c24dd06e74f5cbb07be36a3231b803 to your computer and use it in GitHub Desktop.
Save themeblvd/a4c24dd06e74f5cbb07be36a3231b803 to your computer and use it in GitHub Desktop.
When using a theme with Theme Blvd framework 2.5+, this will adjust search results to use the post grid display.
<?php
/**
* Display search results in a grid.
*/
function my_the_loop_args( $args ) {
if ( is_search() ) {
$args['context'] = 'grid';
}
return $args;
}
add_filter( 'themeblvd_the_loop_args', 'my_the_loop_args' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment