Skip to content

Instantly share code, notes, and snippets.

@joshhartman
Created December 14, 2021 04:14
Show Gist options
  • Save joshhartman/fad2410007f9d0db1538f643656dcd2c to your computer and use it in GitHub Desktop.
Save joshhartman/fad2410007f9d0db1538f643656dcd2c to your computer and use it in GitHub Desktop.

Revisions

  1. joshhartman created this gist Dec 14, 2021.
    15 changes: 15 additions & 0 deletions functions.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    <?php
    // Add new image size for mini gallery
    add_action( 'after_setup_theme', 'custom_theme_setup' );
    function custom_theme_setup(){
    add_image_size( 'mini-thumb', 75, 75, array( 'center', 'center' ) );
    }

    // Register image size for plugins to use
    add_filter( 'image_size_names_choose', 'custom_image_sizes' );
    add_filter( 'uabb_photo_gallery_image_sizes', 'custom_image_sizes' );
    function custom_image_sizes( $sizes ) {
    return array_merge( $sizes, array(
    'mini-thumb' => __( 'Mini Thumb' ),
    ) );
    }