Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Vladimir Zhelnov // neatek.ru // neatek.pw
- // functions.php (Wordpress)
- function theme_add_image(){
- // Here is your sizes.
- // usage in theme : the_post_thumbnail('538x342'); as in array, always => size - 'VALUE1xVALUE2'
- $sizes = array(
- [538, 342],
- [209, 117],
- // [WIDTH, HEIGHT],
- // any new size [WIDTH, HEIGHT],
- );
- foreach ($sizes as $key => $value) {
- add_image_size( $value[0].'x'.$value[1], $value[0], $value[1], true );
- }
- }
- add_action( 'init', 'theme_add_image' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement