Created
January 11, 2025 08:04
-
-
Save Lego2012/f75b33f27decfbd5d0d19e9d56e05c72 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_theme_support( 'post-thumbnails' ); | |
| add_image_size( 'image-480', 480, 9999 ); | |
| add_image_size( 'image-640', 640, 9999 ); | |
| add_image_size( 'image-720', 720, 9999 ); | |
| add_image_size( 'image-960', 960, 9999 ); | |
| add_image_size( 'image-1168', 1168, 9999 ); | |
| add_image_size( 'image-1440', 1440, 9999 ); | |
| add_image_size( 'image-1920', 1920, 9999 ); | |
| function my_custom_sizes( $sizes ) { | |
| return array_merge( $sizes, array( | |
| 'image-480' => 'image-480', | |
| 'image-640' => 'image-640', | |
| 'image-720' => 'image-720', | |
| 'image-960' => 'image-960', | |
| 'image-1168' => 'image-1168', | |
| 'image-1440' => 'image-1440', | |
| 'image-1920' => 'image-1920', | |
| ) ); | |
| } | |
| add_filter( 'image_size_names_choose', 'my_custom_sizes' ); | |
| // Get rid of WP Image Sizes | |
| function add_image_insert_override($sizes) | |
| { | |
| unset($sizes["thumbnail"]); | |
| unset($sizes["medium"]); | |
| unset($sizes["medium_large"]); | |
| unset($sizes["large"]); | |
| unset($sizes["full"]); | |
| return $sizes; | |
| } | |
| add_filter("intermediate_image_sizes_advanced", "add_image_insert_override"); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment