Thanks for the update! I managed to dequeue the standard Gridable stylesheet and change the row class.
However, changing the column class seems a little bit more complicated.
I would like to change gridable--col hand-span-3
to simply col-md-3
.
I tried the gridable_sh_col_classes
filter, but the available $size
seems to contain not the integer, but an array.
So this won’t work:
add_filter( 'gridable_sh_col_classes', 'custom_gridable_classes' );
function custom_gridable_classes( $size ) {
$classes = array( 'col-md-', $size );
return $classes;
}
Instead this will work:
add_filter( 'gridable_sh_col_classes', 'custom_gridable_classes' );
function custom_gridable_classes( $sizes ) {
// Implode array.
$size = implode( '', $sizes );
// Remove all non-numeric characters, so that we get the size of the column as integer.
$size = preg_replace( '/[^0-9]/', '', $size );
// Save the only class as array.
$classes = array( 'col-md-' . $size );
// Return the array.
return $classes;
}
Looks dirty ??
I wish we could change the class names of columns with a simple string (or an array, like in my first example).
Thanks anyway!
-
This reply was modified 8 years, 1 month ago by
ninetienne.
-
This reply was modified 8 years, 1 month ago by
ninetienne.