Output random (custom) image size
I don’t think there exists such function in the WordPress core. Example #1 But you can try something like this: /** * Random image size * @return String Image size */ function wpse_random_image_size() { $sizes = (array) get_intermediate_image_sizes(); return $sizes[array_rand( $sizes )]; } to display a random image size. Usage: if ( function_exists( ‘wpse_random_image_size’ ) … Read more