Need help on WP_Customize_Media_Control
-
WP_Customize_Media_Control
I used WP_Customize_Media_Control to control the image height and width of my image and the output is not proportionate to hero support height and width. What ami missing out here?// Hero Image $wp_customize->add_setting( 'hero_image' , array( 'transport' => 'refresh', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control( new WP_Customize_Media_Control( $wp_customize , 'hero_image' , array( 'label' => __( 'Hero Image', 'ize-theme' ), 'description' => __('Upload hero image', 'ize-theme'), 'settings' => 'hero_image', 'section' => 'hero_section', 'mime_type' => 'image', )) ); add_theme_support( 'hero_image', array( 'height' => 574, 'width' => 780, 'flex-width' => true, 'flex-height' => true, ) ); $ize_theme_hero_image = get_theme_mod( "hero_image" ); <?php if ( !empty($ize_theme_hero_image) ) { echo wp_get_attachment_image( $ize_theme_hero_image, 'hero_image' ) ; } ?>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Need help on WP_Customize_Media_Control’ is closed to new replies.