<?php
/*
 * Template Name: Element
 * Description: A Page Template with a Page Builder design.
 */
get_header(); ?>


<section class="slider" id="elements-slider" data-transition="fade">
  <div class="slider-loader">&nbsp;</div>
  <ul class="slides">

    <li id="elements-slide-1" class="slide" data-parallax="true" data-layout="100%"
        <?php if( function_exists( 'rwmb_meta' ) ) { ?>      
        <?php $images = rwmb_meta( '_cmb_subheader_image', "type=image" ); ?>
        <?php if($images){ foreach ( $images as $image ) { ?>
        <?php 
        $img =  $image['full_url']; ?>
          style="background-image: url('<?php echo esc_url($img); ?>');"
        <?php } } ?>
    <?php } ?>
    >
      <div class="slide-canvas container clearfix">
        <div id="elements-layer-1" class="layer align-center" data-effect="fade-bottom">
          <h1 class="slide-title"><?php $sub_title = get_post_meta(get_the_ID(),'_cmb_sub_title', true); echo htmlspecialchars_decode($sub_title); ?></h1>
        </div>
      </div>
    </li>
  </ul> 
</section>
<section id="content">
      <div id="slider-separator" data-target="#content" class="i-separator animate clearfix"><i class='icon-arrow-down2'></i></div>
      <?php if (have_posts()){ ?>

        <div class="canvas">

          <?php while (have_posts()) : the_post()?>

            <?php the_content(); ?>

          <?php endwhile; ?>

        </div>

        <?php }else {

          _e('Page Canvas For Page Builder', 'startos'); 

        }?>
</section>
<?php get_footer(); ?>