
<?php
/**
 * @package Luzuk Premium
 */
if(get_theme_mod('videocategory_area_disable') != 'on' ){ 
    ?>
    <?php 
    if( get_theme_mod('sec_videocategorysectionTpadding',true) ) {
        $sec_videocategorysectionTpadding = 'padding-top:'.esc_attr(get_theme_mod('sec_videocategorysectionTpadding')).';';
    }
    if( get_theme_mod('sec_videocategorysectionBpadding',true) ) {
        $sec_videocategorysectionBpadding = 'padding-bottom:'.esc_attr(get_theme_mod('sec_videocategorysectionBpadding')).';';
    }

    ?>  
    <div class="videocategory-area wow zoomIn" id="videocategory" style="<?php echo esc_attr($sec_videocategorysectionTpadding); ?>" "<?php echo esc_attr($sec_videocategorysectionBpadding); ?>">
        <?php
            $videocategory_title = get_theme_mod('luzuk_videocategory_title', 'Explore and choose form number of Categories');          
            $videocategory_subtitle = get_theme_mod('videocategory_subtitle', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has industrys. Lorem Ipsum is simply dummy text of the printing and typesetting industry.');
        ?>
        <div class="container">
                <div class="row justify-content-center">
                    <?php if($videocategory_title || $videocategory_subtitle) { ?>
                    <div class="col-md-8 col-md-offset4">
                        <div class="section-title">
                            <h2><?php echo ($videocategory_title);  ?></h2>
                            <p><?php echo ($videocategory_subtitle);  ?></p>
                        </div>
                    </div>
                    <?php }?>
                </div>

            <div class="row">     
                <?php
            if(function_exists('z_taxonomy_image_url')){ ?>
                <?php
                        $args = array(
                            'number'     => 6,
                            'orderby'    => 'title',
                            'order'      => 'ASC',
                            'hide_empty' => false
                        );
                    $product_categories = get_terms( 'video-category', $args );

                        $count = count($product_categories);

                        if ( $count > 0 ){
                            foreach ( $product_categories as $product_category ) {

                                if(function_exists('get_term_meta')){
                                    if( isset( $product_category->term_id ) ){
                                    //show parent categories
                                        $thumbnail_id = get_term_meta($product_category->term_id, 'thumbnail_id', true);
                                
                                      }
                                    // get the image URL for parent category
                                        $image = wp_get_attachment_url($thumbnail_id);
                                    }else{
                                        $image = esc_html(get_template_directory_uri()).'/images/ser1.jpg';
                                    }
                                if( isset( $product_category->name ) ){
                                echo '<div class="col-md-4 col-sm-6 col-xs-12 cat-video-single"> ';

                                ?>                                     
                                <?php

                                 echo ' <div class="video-title-box"> ';
                                  
                                 echo'
                                   <a href="' . get_term_link( $product_category ) . '" data-hover="' . $product_category->name . '" > <img src="'. z_taxonomy_image_url($product_category->term_id) .' " /></a>
                                   ';


                                   echo ' <div class="ser-ot"> ';
                                  
                                    echo '<h4><a href="' . get_term_link( $product_category ) . '" data-hover="' . $product_category->name . '" >
                                    <span> ' . $product_category->name . '</span>
                                     </a>
                                    </h4>' ;
                                      echo'
                                    </div>';
                              
                                 echo'
                                 
                                  </div>
                                </div>';


                    }
                            }


                        }

                    }else{ ?>
                                        <div class="alert alert-warning">
                                            Kindly Install or Activate the Category image plugin.
                                        </div>
                                        <?php }
                        ?>

           
        </div>
        <div class="clearfix"></div>
                
                <div class="videocatmain">
                    <?php
                        $videocat_link = get_theme_mod('videocat_link', '');
                        $videocat_button = get_theme_mod('videocat_button1', 'Explore All');
                    ?>
                    <?php if( get_theme_mod('videocat_button_display','show' ) == 'show') :
                        ?>
                    <div class="videocatbtn">
                        <a class="main-btn btn-3" href="<?php echo $videocat_link ?>"> <?php echo $videocat_button ?> <i class="fa fa-angle-double-right"></i></a>
                    </div>
                    <?php endif ?>
                </div>
</div>
     <div class="clearfix"></div>  
</div>
<?php }