| 1 |
<?php |
| 2 |
/** |
| 3 |
* Slider section for the homepage. |
| 4 |
*/ |
| 5 |
if ( ! function_exists( 'spiceb_spicepress_slider' ) ) : |
| 6 |
|
| 7 |
function spiceb_spicepress_slider() { |
| 8 |
|
| 9 |
$home_slider_image = get_theme_mod('home_slider_image',SPICEB_PLUGIN_URL .'inc/spicepress/images/slider/slider.jpg'); |
| 10 |
$home_slider_title = get_theme_mod('home_slider_title','Welcome to SpicePress Theme'); |
| 11 |
|
| 12 |
$home_slider_discription = get_theme_mod('home_slider_discription','Sea summo mazim ex, ea errem eleifend definitionem vim. Ut nec hinc dolor possim mei ludus efficiendi ei sea summo mazim ex.'); |
| 13 |
$home_slider_btn_txt = get_theme_mod('home_slider_btn_txt','Read More'); |
| 14 |
$home_slider_btn_link = get_theme_mod('home_slider_btn_link',esc_url('#')); |
| 15 |
$home_slider_btn_target = get_theme_mod('home_slider_btn_target',false); |
| 16 |
|
| 17 |
$home_page_slider_enabled = get_theme_mod('home_page_slider_enabled','on'); |
| 18 |
if($home_page_slider_enabled !='off') { |
| 19 |
?> |
| 20 |
<section class="slider" style="position:relative;"> |
| 21 |
<div class="item" style="background-image:url(<?php echo $home_slider_image; ?>); width: 100%; height: 90vh; background-position: center center; background-size: cover; z-index: 0;" > |
| 22 |
<?php $slider_image_overlay = get_theme_mod('slider_image_overlay',true); |
| 23 |
$slider_overlay_section_color = get_theme_mod('slider_overlay_section_color','rgba(0,0,0,0.30)'); |
| 24 |
if($slider_image_overlay != false) { ?> |
| 25 |
<div class="overlay" style="background-color:<?php echo $slider_overlay_section_color;?>"></div> |
| 26 |
<?php } ?> |
| 27 |
<div class="container"> |
| 28 |
<div class="format-standard"> |
| 29 |
<?php if( ($home_slider_title) || ($home_slider_discription)!='' ) { ?> |
| 30 |
<div class="slide-text-bg1"> |
| 31 |
<?php if ( ! empty( $home_slider_title ) || is_customize_preview() ) { ?> |
| 32 |
<h1><?php echo $home_slider_title; ?></h1> |
| 33 |
<?php } |
| 34 |
if ( ! empty( $home_slider_discription ) || is_customize_preview() ) { |
| 35 |
?> |
| 36 |
<p><?php echo $home_slider_discription; ?></p> |
| 37 |
<?php } ?> |
| 38 |
</div> |
| 39 |
<?php } if($home_slider_btn_txt) { ?> |
| 40 |
<div class="slide-btn-area-sm"> |
| 41 |
<a <?php if($home_slider_btn_link) { ?> href="<?php echo $home_slider_btn_link; } ?>" |
| 42 |
<?php if($home_slider_btn_target) { ?> target="_blank" <?php } ?> class="slide-btn-sm"> |
| 43 |
<?php if($home_slider_btn_txt) { echo $home_slider_btn_txt; } ?></a> |
| 44 |
</div> |
| 45 |
<?php } ?> |
| 46 |
</div> |
| 47 |
</div> |
| 48 |
</div> |
| 49 |
</section> |
| 50 |
<?php |
| 51 |
} |
| 52 |
} |
| 53 |
|
| 54 |
endif; |
| 55 |
|
| 56 |
if ( function_exists( 'spiceb_spicepress_slider' ) ) { |
| 57 |
$section_priority = apply_filters( 'spicepress_section_priority', 11, 'spiceb_spicepress_slider' ); |
| 58 |
add_action( 'spiceb_spicepress_sections', 'spiceb_spicepress_slider', absint( $section_priority ) ); |
| 59 |
|
| 60 |
} |