He escrito el siguiente código para una imagen:
function wp_mytheme_register_images_start($wp_customize){
// Section
$wp_customize->add_section('sec_start_images', array(
'title' => 'Startseite-Bilder',
'description' => 'Reihenfolge der Bilder für die Startseite',
)
);
// Settings
$wp_customize->add_setting('set_start_images_3', array(
//'type' => 'theme_mod',
'default' => '',
// 'capability' => 'edit_theme_options',
'sanitize_callback' => 'absint',
'transport' => 'refresh',
'height' => 310
));
// Controls
$wp_customize->add_control( new WP_Customize_Cropped_Image_Control( $wp_customize, 'ctrl_start_image_3', array(
'label' => __(‚Image‘ #1, 'wp_my’theme),
'section' => 'sec_start_images',
'settings' => 'set_start_images_3',
'flex_width' => false,
'flex_height' => false,
'width' => 1920,
'height' => 310
)));
}
add_action('customize_register', 'wp_mytheme_register_images_start');
He incrustado el siguiente código en mi sitio:
<section class="section-bottom-banner">
<img src="https://stackoverflow.com/questions/59269083/<?php echo esc_url(get_theme_mod("set_start_images_3')); ?>" alt="">
</section>
Como salida obtengo solo un número (http://280).
¿¿Qué estoy haciendo mal??
Tx
.