我的标题中安装了以下代码。php:
<h1><img src="<?php echo esc_url( get_theme_mod( \'mitch_logo\' ) ); ?>" alt="<?php echo esc_attr( get_bloginfo( \'name\', \'display\' ) ); ?>"></h1>
在我的职能中。php,我有以下代码:
$wp_customize->add_section( \'mitch_logo_section\' , array(
\'title\' => __( \'Logo\', \'mitch_logo\' ),
\'priority\' => 30,
\'description\' => \'Upload your logo.\',
) );
$wp_customize->add_setting( \'mitch_logo\' );
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, \'mitch_logo\', array(
\'label\' => __( \'Logo\', \'mitch_logo\' ),
\'section\' => \'mitch_logo_section\',
\'settings\' => \'mitch_logo\',
) ) );
很好,但我想找一个叫
.logo
标志宽度和高度。我怎么得到这些?
.logo {
width:{width}; // how to get width of image?
height:{height}; // how to get height of image?
background: ...;
}
因为你需要宽度和高度来获得一个有背景的div。