<?php | |
/* Use only code below | |
/** | |
* Use shortcode_atts_gallery filter to add new defaults to the WordPress gallery shortcode. | |
* New gallery shortcode defaults (columns="2" and size="medium"). | |
* Allows user input in the post gallery shortcode. | |
* | |
* @author Marcy Diaz | |
* @link http://amethystwebsitedesign.com/how-to-use-larger-images-in-a-wordpress-gallery/ | |
*/ | |
function amethyst_gallery_atts( $out, $pairs, $atts ) { | |
$atts = shortcode_atts( array( | |
'columns' => '2', | |
'size' => 'medium', | |
), $atts ); | |
$out['columns'] = $atts['columns']; | |
$out['size'] = $atts['size']; | |
return $out; | |
} | |
add_filter( 'shortcode_atts_gallery', 'amethyst_gallery_atts', 10, 3 ); |
This comment has been minimized.
This comment has been minimized.
This is awesome, thanks! I am so tired of my clients forgetting to set "link" to media file ... |
This comment has been minimized.
This comment has been minimized.
should this code be placed in functions.php? |
This comment has been minimized.
This comment has been minimized.
@riddy92 yes! Note this is 5 year old code so not sure it still works! |
This comment has been minimized.
This comment has been minimized.
I am not sure also, I ended up using CSS to solve my issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
does not work as expected