Skip to content

Instantly share code, notes, and snippets.

@hirejordansmith
Created February 19, 2018 20:33
Show Gist options
  • Save hirejordansmith/e2e6214f5773d030663c6a1276ad2cbf to your computer and use it in GitHub Desktop.
Save hirejordansmith/e2e6214f5773d030663c6a1276ad2cbf to your computer and use it in GitHub Desktop.
HJS // Force WordPress Images to link to Media File instead of Attachment Page Globally
<?php
add_shortcode( 'gallery', 'my_gallery_shortcode' );
function my_gallery_shortcode( $atts ) {
$atts['link'] = 'file';
return gallery_shortcode( $atts );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment