Skip to content

Instantly share code, notes, and snippets.

@luistinygod
Created August 18, 2015 15:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save luistinygod/6ff352a2f3442bf6715b to your computer and use it in GitHub Desktop.
Save luistinygod/6ff352a2f3442bf6715b to your computer and use it in GitHub Desktop.
GravityView: Convert a list view into a grid style (3-col)
<?php
/**
* Add the `gv-grid` class to the list container
*/
function my_gv_list_container( $classes ) {
return $classes . ' gv-grid';
}
add_filter( 'gravityview/render/container/class', 'my_gv_list_container', 10, 1 );
/**
* Add the `gv-grid-col-1-3` class to the entries container
*/
function my_gv_list_entry_container( $classes, $entry, $instance ) {
return $classes . ' gv-grid-col-1-3';
}
add_filter( 'gravityview_entry_class', 'my_gv_list_entry_container', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment