Support

Account

Home Forums Add-ons Gallery Field Gallery medium-large dimensions

Helping

Gallery medium-large dimensions

  • Hi,
    Before I purchase I just want to know how do you specify the [medium-width/height] and [large-width/height] of images?

  • You can specify the dimension of any thumbnails by adding a filter to your function.php:

    if ( !function_exists('theme_setup') ) :
    
      function theme_setup() {
    
        // Add post thumbnails (http://codex.wordpress.org/Post_Thumbnails)
        add_theme_support('post-thumbnails');
    
        add_image_size( 'one-thumb-slider', 1170, 430, true );
        add_image_size( 'two-thumb-full', 900, 500, true );
    
        add_filter( 'image_size_names_choose', 'custom_image_sizes' );
        
      }
    endif;
    
    add_action('after_setup_theme', 'theme_setup');

    Then in your loop:

    <img src="<?php echo $image['sizes']['two-thumb-full']; ?>" alt="<?php echo $image['alt']; ?>" />

    Note: Remember to add the filter before uploading any images otherwise you need to reset all the thumbs via a plugin or delete and re-upload all the images.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Gallery medium-large dimensions’ is closed to new replies.