Created
April 7, 2014 19:53
-
-
Save Viper007Bond/10040166 to your computer and use it in GitHub Desktop.
Default WordPress to use 4 column galleries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'shortcode_atts_gallery', 'sheri_galleries_default_to_four_columns', 10, 3 ); | |
function sheri_galleries_default_to_four_columns( $atts, $defaults, $raw_atts ) { | |
// Don't override manually-set number of columns | |
if ( ! empty( $raw_atts['columns'] ) ) { | |
return $atts; | |
} | |
$atts['columns'] = 4; | |
return $atts; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment