Does anyone know the easiest way for WordPress [gallery] to force x number of columns display without tampering the core or manually set the columns value to the shortcode?
I could only figure out 2 possible ways:
function / code duplication
Regular expression
If you use [gallery] shortcode without setting the columns value, the default is set to [...]
Dump this code anywhere in Theme’s template functions.php file (For example, functions.php file for a Theme named “default” would probably reside in the directory wp-content/themes/default/functions.php):
add_filter(‘gallery_style’,
create_function(
‘$css’,
‘return preg_replace(“#<style type=\’text/css\’>(.*?)</style>#s”, “”, $css);’
)
);
And these are the classes for your stylesheet:
.gallery {}
.gallery-item {}
.gallery-icon {}
.gallery-caption {}