fix relative url default preview image

This commit is contained in:
Jonas Heinrich 2020-06-18 15:33:09 +02:00
parent 106d12341a
commit 77c2cdffe8
3 changed files with 14 additions and 14 deletions

View file

@ -139,8 +139,11 @@ get_header();
<figure class="teaser-box-image"> <figure class="teaser-box-image">
<?php if ( has_post_thumbnail() ) { ?> <?php if ( has_post_thumbnail() ) { ?>
<img src="<?php echo get_the_post_thumbnail_url(); ?>"> <img src="<?php echo get_the_post_thumbnail_url(); ?>">
<?php } else { ?> <?php } else {
<img src="<?php echo esc_url( get_option( 'kit_defaultimage' ) ); ?>"> $custom_logo_id = get_theme_mod( 'kit_defaultimage' );
$logo = wp_get_attachment_image_src( $custom_logo_id , 'full' );
?>
<img src="<?php echo esc_url( $logo[0] ); ?>">
<?php } ?> <?php } ?>
</figure> </figure>
</a> </a>

View file

@ -57,8 +57,11 @@ get_header();
<figure class="teaser-box-image"> <figure class="teaser-box-image">
<?php if ( has_post_thumbnail() ) { ?> <?php if ( has_post_thumbnail() ) { ?>
<img src="<?php echo get_the_post_thumbnail_url(); ?>"> <img src="<?php echo get_the_post_thumbnail_url(); ?>">
<?php } else { ?> <?php } else {
<img src="<?php echo esc_url( get_option( 'kit_defaultimage' ) ); ?>"> $custom_logo_id = get_theme_mod( 'kit_defaultimage' );
$logo = wp_get_attachment_image_src( $custom_logo_id , 'full' );
?>
<img src="<?php echo esc_url( $logo[0] ); ?>">
<?php } ?> <?php } ?>
</figure> </figure>
</a> </a>

View file

@ -194,15 +194,9 @@ function theme_customize_register( $wp_customize ) {
) )
) ); ) );
$wp_customize->add_setting( 'kit_defaultimage', array( $wp_customize->add_setting( 'kit_defaultimage' );
'default' => '', $wp_customize->add_control( new WP_Customize_Media_Control(
'type' => 'option', $wp_customize, 'kit_defaultimage', array(
'capability' => 'edit_theme_options'
),
);
$wp_customize->add_control( new WP_Customize_Image_Control(
$wp_customize, 'kit_defaultimage_control', array(
'label' => __( 'Default featured image', 'kit' ), 'label' => __( 'Default featured image', 'kit' ),
'settings' => 'kit_defaultimage', 'settings' => 'kit_defaultimage',
'section' => 'title_tagline', 'section' => 'title_tagline',