<?php

/**
 * Use for the show the testimonials at home page and in testimonial page with shortcode
 * @param int $pageId default is null the id of a post
 * @param boolean $isCustomizer default is false if set to true it mean the output is set for the home page
 * @param int $i default null
 * @param boolean $showStaticVals default is false
 * @return string
 * @author Luzuk <support@luzuk.com>
 * */

/*gallery*/ 

function galleryShortCode($pageId = null, $isCustomizer = false, $i = null) {

    ob_start();

    $args = array('post_type' => 'our-gallery');
    if (!empty($pageId)) {
        $args['page_id'] = absint($pageId);
    }
    $args['posts_per_page'] = -1;
    $colCls = '';
    // if($isCustomizer == true){
    $cols = get_theme_mod('luzuk_gallery_npp_count', 2);  
    ++$cols;
    switch ($cols) {
        case 1:
        $colCls = 'col-md-12 col-sm-12 col-xs-12'; 
        break;
        case 2:
        $colCls = 'col-md-6 col-sm-6 col-xs-12';
        break;
        case 3:
        case 5:
        case 6:
        case 9:
        $colCls = 'col-md-4 col-sm-6 col-xs-12';
        break;
        case 4:
        case 7:
        case 8:
        case 10:
        case 11:
        case 12:
        $colCls = 'col-md-3 col-sm-6 col-xs-12';
        break;
        default:
        $colCls = 'col-md-4 col-sm-6 col-xs-12';
        break;
    }
    // }
    $text = '';
    $query = new WP_Query($args);
    if ($query->have_posts()):
        $postN = 0;

        while ($query->have_posts()) : $query->the_post();
            $luzuk_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'medium_large');
       
            $post = get_post();
            ?> 
                <div class="col-md-3 col-sm-6 col-xs-12 gallery-box">
                    <div class="lz-gallery-images innergallery ">
                                <?php
                          if (has_post_thumbnail()) {
                            $image_url = $luzuk_image[0];
                        } else {
                            $image_url = get_template_directory_uri() . '/images/about1.jpg';
                        }
                        ?>
                         <a class="group1 ginerborder" href="<?php echo esc_url($image_url); ?>" title="<?php the_title(); ?>">

                          <img class="secondry-bg img-responsive" src="<?php echo esc_url($image_url); ?>" alt="<?php the_title(); ?>" />
                             <ul class="gallery-icon">
                                <li>
                                   <i class="fa fa-camera" ></i>
                                   
                                </li>
                            </ul>
                        </a>
                    </div>


                </div>
                            <?php
                        endwhile;
                        $text = ob_get_contents();
                        ob_clean();
                    endif;
                    wp_reset_postdata();
                    return $text;
                }


    /**
     * Use for the show the testimonials at home page and in testimonial page with shortcode
     * @param int $pageId default is null the id of a post
     * @param boolean $isCustomizer default is false if set to true it mean the output is set for the home page
     * @param int $i default null
     * @param boolean $showStaticVals default is false
     * @return void
     * @author Luzuk <support@luzuk.com>
     * */



