Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1194584

    Hi, im try override the global avia config within child functions php but with no luck.
    The three new sizes dont show up.

    My code

    // Adicionando tamanho customizados
    function avia_change_image_size_array() {
    global $avia_config;
    $avia_config['imgSize']['widget'] 			 	= array('width'=>36,  'height'=>36);						// small preview pics eg sidebar news
    $avia_config['imgSize']['square'] 		 	    = array('width'=>180, 'height'=>180);		                 // small image for blogs
    $avia_config['imgSize']['featured'] 		 	= array('width'=>1200, 'height'=>670 );						// images for fullsize pages and fullsize slider
    $avia_config['imgSize']['featured_large'] 		= array('width'=>1500, 'height'=>630 );						// images for fullsize pages and fullsize slider
    $avia_config['imgSize']['extra_large'] 		 	= array('width'=>1500, 'height'=>1500 , 'crop' => false);	// images for fullscrren slider
    $avia_config['imgSize']['portfolio'] 		 	= array('width'=>495, 'height'=>400 );						// images for portfolio entries (2,3 column)
    $avia_config['imgSize']['portfolio_small'] 		= array('width'=>260, 'height'=>185 );						// images for portfolio 4 columns
    $avia_config['imgSize']['gallery'] 		 		= array('width'=>845, 'height'=>684 );						// images for portfolio entries (2,3 column)
    $avia_config['imgSize']['magazine'] 		 	= array('width'=>710, 'height'=>375 );						// images for magazines
    $avia_config['imgSize']['masonry'] 		 		= array('width'=>705, 'height'=>705 , 'crop' => false);		// images for fullscreen masonry
    $avia_config['imgSize']['entry_with_sidebar'] 	= array('width'=>845, 'height'=>321);		            	// big images for blog and page entries
    $avia_config['imgSize']['entry_without_sidebar']= array('width'=>1210, 'height'=>423 );						
    // Imagem materia
    $avia_config['imgSize']['materia']              = array('width'=>1200, 'height'=>670 );                     
    // Imagem r7
    $avia_config['imgSize']['r7-imagem']            = array('width'=>660, 'height'=>360 );                      
    // veja-mais
    $avia_config['imgSize']['veja-mais']            = array('width'=>157, 'height'=>112 );   
    // images for fullsize pages and fullsize slider
    $avia_config['imgSize'] = apply_filters('avf_modify_thumb_size', $avia_config['imgSize']);
    
    $avia_config['slectableImgSize'] = array(
    'square' 				=> __('Square','avia_framework'),
    	'featured'  			=> __('Featured Thin','avia_framework'),
    	'featured_large'  		=> __('Featured Large','avia_framework'),
    	'portfolio' 			=> __('Portfolio','avia_framework'),
    	'gallery' 				=> __('Gallery','avia_framework'),
    	'entry_with_sidebar' 	=> __('Entry with Sidebar','avia_framework'),
    	'entry_without_sidebar'	=> __('Entry without Sidebar','avia_framework'),
    	'extra_large' 			=> __('Fullscreen Sections/Sliders','avia_framework'),
    	'materia'               => __('Materia','avia_framework'),
    	'r7-imagem'             => __('R7 Imagem','avia_framework'),
    	'veja-mais'             => __('Veja Mais','avia_framework'),
    
    );
    }
    add_action( 'init', 'avia_change_image_size_array');
    #1195272

    Hey Rafael,
    Sorry for the late reply, Try adding this code to the end of your functions.php file in Appearance > Editor:

    add_image_size( 'materia', 1200, 670, true );
    add_image_size( 'r7-imagem', 660, 360, true );
    add_image_size( 'veja-mais', 157, 112, true );
    add_filter( 'image_size_names_choose', 'my_custom_sizes' );
    function my_custom_sizes( $sizes ) {
        return array_merge( $sizes, array(
            'materia'               => __('Materia','avia_framework'),
    		'r7-imagem'             => __('R7 Imagem','avia_framework'),
    		'veja-mais'             => __('Veja Mais','avia_framework'),
        ) );
    }

    I tested this and the sizes showed in my media sizes while using the “Simple Image Sizes” plugin to display the media sizes.
    2020-03-22_121551.png

    Best regards,
    Mike

    #1195489

    Tks, it worked perfectly! Take care

    #1195622

    Hi,

    I’m glad this was resolved. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Add new image sizes on child functions php’ is closed to new replies.