<?php
/* Template name: Home */
get_header();
?>
<main>
	
    <?php include 'components/bannerHome.php'; ?>

    <?php if( have_rows('block_order') ): ?>
        <?php while( have_rows('block_order') ): the_row(); 
            $block = get_sub_field('block');
        ?>
        <?php if( $block == 'Most Popular' ): ?>

          <?php  include 'components/mostPopular.php'; ?>

        <div id="ad-home-bottom-mostpopular" >         
          <?php echo do_shortcode( '[the_ad id="29721"]' ); ?>
        </div>

        <?php elseif( $block == 'News' ): ?>

          <?php  include 'components/sectionCategory-news.php'; ?>

          <!-- <div class="addhome adds addhome1">
          <div class="contentAdd" style="background: #000;"></div>
          </div> -->
          <div id="ad-home-bottom-news">
            <?php echo do_shortcode( '[the_ad id="29725"]' ); ?>
          </div>

        <?php elseif( $block == 'Totalpoll' ): ?>

          <section id="sectionVote" style="background-color: <?php the_field('background_color'); ?>; background-image: url(<?php the_field('background_image'); ?>);">
            <div class="container"> 
                <?php echo do_shortcode(get_field('shortcode')); ?>
            </div>
          </section>

          <!-- <div class="addhome adds hideDesktop">
          <div class="contentAdd" style="background: #EF1366;"></div>
          </div> -->

        <?php elseif( $block == 'Have Your Say' ): ?>

          <?php include 'components/sectionCategory-haveYourSay.php'; ?>

          <!-- <div class="addhome adds addhome2">
          <div class="contentAdd" style="background: #000;"></div>
          </div> -->
        <div id="ad-home-bottom-have-your-say" >
            <?php echo do_shortcode( '[the_ad id="29727"]' ); ?>
          </div>
          
        <?php elseif( $block == 'Business' ): ?>

          <?php include 'components/sectionCategory-business.php'; ?>

          <!-- <div class="addhome adds addhome2">
          <div class="contentAdd" style="background: #000;"></div>
          </div> -->
          <div id="ad-home-bottom-business" >
            <?php echo do_shortcode( '[the_ad id="29726"]' ); ?>
          </div>
        <?php elseif( $block == 'Life' ): ?>

          <?php include 'components/sectionCategory-life.php'; ?>

          <!-- <div class="addhome adds addhome1">
          <div class="contentAdd" style="background: #EF1366;"></div>
          </div> -->
          <div id="ad-home-bottom-life" >
            <?php echo do_shortcode( '[the_ad id="29728"]' ); ?>
          </div>
        <?php elseif( $block == 'Entertainment' ): ?>

          <?php include 'components/sectionCategory-entertainment.php'; ?>

          <!-- <div class="addhome adds addhome2">
          <div class="contentAdd" style="background: #000;"></div>
          </div> -->
          <div id="ad-home-bottom-entertainment" >
            <?php echo do_shortcode( '[the_ad id="29730"]' ); ?>
          </div>
        <?php endif; ?>
            
        <?php endwhile; ?>
    <?php endif; ?>
    





    

    

    

    

    


</main>
<?php get_footer(); ?>