Skip to content

Instantly share code, notes, and snippets.

@shazdeh
Created December 20, 2013 23:16
Show Gist options
  • Save shazdeh/8063162 to your computer and use it in GitHub Desktop.
Save shazdeh/8063162 to your computer and use it in GitHub Desktop.
Custom size for images displayed in attachment pages
<?php
function custom_attachment_size( $content ) {
if( is_attachment() ) {
global $post;
$content = wp_get_attachment_image( $post->ID, 'large' );
}
return $content;
}
add_filter( 'the_content', 'custom_attachment_size' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment