<?php
/**
 * Template Name: Sparta Template One Page
 *
 **/

get_header();
?>
    <section class="vk-content">
        <div class="vk-home onepage ">
            <div class="vk-mouse-scroll hidden">
                <span class="vk-icon ti-mouse"></span>
            </div>
            <div class="vk-navbar-right-fixed">
                <ul id="navScroll2Id" class="vk-list vk-nav-scroll-to-id">
                    <?php
                        $meta_idonepage = get_post_meta($post->ID, 'univer_idonepage', true);
                        $i = 1;
                        if ($meta_idonepage && $meta_idonepage !== '' && $meta_idonepage[0] !== ''):
                            foreach ($meta_idonepage as $item):
                                ?>
                                <li <?php if ($i === 1) { echo 'class="current"'; } ?>><a href="#<?php echo esc_attr($item); ?>"></a></li>
                                <?php
                                $i++;
                            endforeach;
                        endif;
                    ?>
            </div>
            <?php
            while (have_posts()) : the_post();
                ?>
                <div id="onpage-content" class="container">
                    <?php
                    the_content();
                    ?>
                </div>
            <?php
            endwhile;
            ?>
            <?php
            $show_contact_social = get_theme_mod('sparta_social_on', array('facebook', 'twitter', 'google', 'pinterest', 'youtube', 'instagram'));

            if (!empty($show_contact_social) && is_array($show_contact_social)) :
                echo '<div class="box-social-link">';
                echo '<ul class="vk-list vk-list-inline vk-list-social-footer">';
                foreach ($show_contact_social as $part) : ?>
                    <?php if (get_theme_mod('sparta_acc_' . $part) != ''): ?>
                        <li>
                            <a href="<?php echo esc_attr(get_theme_mod('sparta_acc_' . $part)); ?>">
                                <i class="fa fa-<?php echo esc_html($part); ?>"></i>
                            </a>
                        </li>
                    <?php
                    endif;
                endforeach;
                echo '</ul>';
                echo '</div>';
            endif;
            ?>
        </div>
    </section>
<?php

get_footer();
