Adds option to display post featured image on the site header banner. #32
This commit is contained in:
parent
0b223a7656
commit
217c100e7f
|
@ -494,7 +494,7 @@ nav {
|
||||||
|
|
||||||
nav.menu-belowheader {
|
nav.menu-belowheader {
|
||||||
.container-fluid {
|
.container-fluid {
|
||||||
margin: 0px 16px 0px 0px !important;
|
margin: 0px 16px 0px -6px !important;
|
||||||
}
|
}
|
||||||
#menubelowHeader > ul > li.menu-item {
|
#menubelowHeader > ul > li.menu-item {
|
||||||
padding-left: 0px;
|
padding-left: 0px;
|
||||||
|
|
|
@ -599,6 +599,24 @@ function tainacan_customize_register( $wp_customize ) {
|
||||||
'fallback_refresh' => true
|
'fallback_refresh' => true
|
||||||
) );
|
) );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds option to display featured image on site header
|
||||||
|
*/
|
||||||
|
$wp_customize->add_setting( 'tainacan_featured_image_on_header_banner', array(
|
||||||
|
'type' => 'theme_mod',
|
||||||
|
'capability' => 'edit_theme_options',
|
||||||
|
'default' => false,
|
||||||
|
'transport' => 'refresh',
|
||||||
|
'sanitize_callback' => 'tainacan_callback_sanitize_checkbox'
|
||||||
|
) );
|
||||||
|
$wp_customize->add_control( 'tainacan_featured_image_on_header_banner', array(
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'priority' => 99, // Within the section.
|
||||||
|
'section' => 'header_image',
|
||||||
|
'label' => __( 'Display post or page featured image on the header banner', 'tainacan-interface' ),
|
||||||
|
'description' => __( 'Toggle to display the current post or page featured image, if available on the header banner instead of the default image. This feature also hides the featured image in the post content.', 'tainacan-interface' )
|
||||||
|
) );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bellow are customizer options exclusivelly related to Tainacan pages.
|
* Bellow are customizer options exclusivelly related to Tainacan pages.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
<?php if ( false == get_theme_mod( 'tainacan_hide_header_banner', false ) ) : ?>
|
<?php if ( false == get_theme_mod( 'tainacan_hide_header_banner', false ) ) :
|
||||||
<div <?php if ( get_header_image() ) : ?>class="page-header header-filter clear-filter page-height" style="background-image: url('<?php header_image(); ?>')"<?php else : ?>class="page-header header-filter clear-filter align-items-center" style="background-image: url('<?php echo esc_url( get_template_directory_uri() ) ?>/assets/images/capa.png')"<?php endif; ?>>
|
if ( !is_singular() || false == get_theme_mod('tainacan_featured_image_on_header_banner', false) || !has_post_thumbnail() ) : ?>
|
||||||
|
<div <?php if ( get_header_image() ) : ?>class="page-header header-filter clear-filter page-height" style="background-image: url('<?php header_image(); ?>')"<?php else : ?>class="page-header header-filter clear-filter align-items-center" style="background-image: url('<?php echo esc_url( get_template_directory_uri() ) ?>/assets/images/capa.png')"<?php endif; ?>>
|
||||||
|
<?php else: ?>
|
||||||
|
<div class="page-header header-filter clear-filter page-height" style="background-image: url('<?php echo get_the_post_thumbnail_url(); ?>')">
|
||||||
|
<?php endif; ?>
|
||||||
<div class="container-fluid p-0 ph-title-description">
|
<div class="container-fluid p-0 ph-title-description">
|
||||||
<?php if ( false == get_theme_mod( 'tainacan_hide_site_title_on_header_banner', false ) ) : ?>
|
<?php if ( false == get_theme_mod( 'tainacan_hide_site_title_on_header_banner', false ) ) : ?>
|
||||||
<div
|
<div
|
||||||
|
|
|
@ -33,7 +33,11 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php the_post_thumbnail(); ?>
|
<?php
|
||||||
|
if ( get_theme_mod('tainacan_featured_image_on_header_banner', false) == false ) {
|
||||||
|
the_post_thumbnail();
|
||||||
|
}
|
||||||
|
?>
|
||||||
</header>
|
</header>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<section class="tainacan-content text-black margin-two-column">
|
<section class="tainacan-content text-black margin-two-column">
|
||||||
|
|
Loading…
Reference in New Issue