<?php
/**
 * Template Name: Home Page
 */

get_header();
?>

<?php 
$slide_count = get_theme_mod('magenta_plus_slide_number');
$main_slider_wrap = absint(get_theme_mod('magenta_plus_enable_slider', 1));
if($main_slider_wrap == 1){ 
?>

<section id="main-slider-wrap">
    <div class="owl-carousel">
        <?php for ($i=1; $i<=$slide_count; $i++) { ?>
            <div class="main-slider-inner-box">
                <?php if ( get_theme_mod('magenta_plus_slider_image'.$i) ) : ?>
                    <img src="<?php echo esc_url( get_theme_mod('magenta_plus_slider_image'.$i) ); ?>">
                    <div class="main-slider-content-box">
                        <?php if ( get_theme_mod('magenta_plus_slider_heading'.$i) ) : ?><h3><?php echo esc_html( get_theme_mod('magenta_plus_slider_heading'.$i) ); ?></h3><?php endif; ?>
                        <?php if ( get_theme_mod('magenta_plus_slider_text'.$i) ) : ?><p><?php echo esc_html( get_theme_mod('magenta_plus_slider_text'.$i) ); ?></p><?php endif; ?>
                        <div class="main-slider-button">
                            <?php if ( get_theme_mod('magenta_plus_slider_button1_link'.$i) ||  get_theme_mod('magenta_plus_slider_button1_text'.$i )) : ?><a href="<?php echo esc_url( get_theme_mod('magenta_plus_slider_button1_link'.$i) ); ?>"><?php echo esc_html( get_theme_mod('magenta_plus_slider_button1_text'.$i) ); ?><i class="fas fa-angle-right"></i></a><?php endif; ?>
                            <?php if ( get_theme_mod('magenta_plus_slider_button2_link'.$i) ||  get_theme_mod('magenta_plus_slider_button2_text'.$i )) : ?><a class="slider-button2" href="<?php echo esc_url( get_theme_mod('magenta_plus_slider_button2_link'.$i) ); ?>"><?php echo esc_html( get_theme_mod('magenta_plus_slider_button2_text'.$i) ); ?><i class="fas fa-angle-right"></i></a><?php endif; ?>
                        </div>
                    </div>
                <?php endif; ?>
            </div>
        <?php } ?>
    </div>
</section>

<?php } ?>

<?php 
$main_expert_wrap = absint(get_theme_mod('magenta_plus_enable_expert', 1));
if($main_expert_wrap == 1){ 
?>

<section id="main-expert-wrap">
    <div class="container">
        <div class="main-expert-heading">
            <?php if ( get_theme_mod('magenta_plus_expert_heading') ) : ?><h3><?php echo esc_html( get_theme_mod('magenta_plus_expert_heading') ); ?></h3><?php endif; ?>
            <?php if ( get_theme_mod('magenta_plus_expert_text') ) : ?><p><?php echo esc_html( get_theme_mod('magenta_plus_expert_text') ); ?></p><?php endif; ?>
        </div>
        <div class="rel-post-wrap">
            <?php for ($i=1; $i <= 4; $i++) { ?>
                <div class="main-expert-inner-box rel-card-item">
                    <?php if ( get_theme_mod('magenta_plus_expert_image'.$i) ) : ?><img src="<?php echo esc_url( get_theme_mod('magenta_plus_expert_image'.$i) ); ?>"><?php endif; ?>
                    <div class="main-expert-content-box ">
                        <?php if ( get_theme_mod('magenta_plus_expert_box_heading'.$i) ) : ?><h4><?php echo esc_html( get_theme_mod('magenta_plus_expert_box_heading'.$i) ); ?></h4><?php endif; ?>
                        <?php if ( get_theme_mod('magenta_plus_expert_box_text'.$i) ) : ?><p><?php echo esc_html( get_theme_mod('magenta_plus_expert_box_text'.$i) ); ?></p><?php endif; ?>
                    </div>
                </div>
            <?php } ?>
        </div>
    </div>
</section>

<?php } ?>

<?php
get_footer();
