Skip to content

Instantly share code, notes, and snippets.

@webmasterninjay
Created August 12, 2019 17:01
Show Gist options
  • Save webmasterninjay/5e15379cf6578478f23ecf9303e9f676 to your computer and use it in GitHub Desktop.
Save webmasterninjay/5e15379cf6578478f23ecf9303e9f676 to your computer and use it in GitHub Desktop.
Add custom image size and display on media size selection.
<?php
// AB Post Grid image thumb
add_image_size( 'ab-blog-thumb', 337, 224, TRUE );
add_filter( 'image_size_names_choose', 'ab_blog_thumb_size' );
function ab_blog_thumb_size( $sizes ) {
return array_merge( $sizes, array(
'ab-blog-thumb' => __( 'AB Grid Thumbnail' ),
) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment