define default featured image on page
This commit is contained in:
parent
77306b737b
commit
28be03d171
3 changed files with 21 additions and 2 deletions
|
|
@ -139,7 +139,9 @@ 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 } ?>
|
<?php } else { ?>
|
||||||
|
<img src="<?php echo esc_url( get_option( 'kit_defaultimage' ) ); ?>">
|
||||||
|
<?php } ?>
|
||||||
</figure>
|
</figure>
|
||||||
</a>
|
</a>
|
||||||
<?php echo '<a href="' . esc_url( get_permalink() ) . '">'; ?>
|
<?php echo '<a href="' . esc_url( get_permalink() ) . '">'; ?>
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,9 @@ 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 } ?>
|
<?php } else { ?>
|
||||||
|
<img src="<?php echo esc_url( get_option( 'kit_defaultimage' ) ); ?>">
|
||||||
|
<?php } ?>
|
||||||
</figure>
|
</figure>
|
||||||
</a>
|
</a>
|
||||||
<?php echo '<a href="' . esc_url( get_permalink() ) . '">'; ?>
|
<?php echo '<a href="' . esc_url( get_permalink() ) . '">'; ?>
|
||||||
|
|
|
||||||
|
|
@ -194,6 +194,21 @@ function theme_customize_register( $wp_customize ) {
|
||||||
)
|
)
|
||||||
) );
|
) );
|
||||||
|
|
||||||
|
$wp_customize->add_setting( 'kit_defaultimage', array(
|
||||||
|
'default' => '',
|
||||||
|
'type' => 'option',
|
||||||
|
'capability' => 'edit_theme_options'
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
$wp_customize->add_control( new WP_Customize_Image_Control(
|
||||||
|
$wp_customize, 'kit_defaultimage_control', array(
|
||||||
|
'label' => __( 'Default featured image', 'kit' ),
|
||||||
|
'settings' => 'kit_defaultimage',
|
||||||
|
'section' => 'title_tagline',
|
||||||
|
)
|
||||||
|
) );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
add_action( 'customize_register', 'theme_customize_register' );
|
add_action( 'customize_register', 'theme_customize_register' );
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue