<?phpinclude '../../../wp-load.php';$loadedString = $_POST['loaded'];$loaded = array_map('intval', explode(",", $loadedString));$category = $_POST['category'];$global_categories = isset($_POST['global_categories']) ? $_POST['global_categories'] : false;$pf_index = isset($_POST['pf_index']) && $_POST['pf_index'] != '' ? "_" . $_POST['pf_index'] : "";$ppp = ggt_theme_option('port_ajax_num' . $pf_index) ;$index = 1;$port_args = array(    'post_type' => 'portfolio',    'posts_per_page' => $ppp,    'post__not_in' => $loaded);/** * Category filter */if ($category && $category != '' && $category != 'false' && $category != "*") {    $port_args["tax_query"] = array(        array(            'taxonomy' => 'project-type',            'field' => 'slug',            'terms' => $category)    );}else if($global_categories && is_array($global_categories) && sizeof($global_categories) >= 1){    $port_args["tax_query"] = array(        array(            'taxonomy' => 'project-type',            'field' => 'slug',            'terms' => $global_categories        )    );}$posts_left = true;ob_start();$the_query = new WP_Query($port_args);if(ggt_theme_option("port_reorder_switch" . $pf_index)){    $port_args["orderby"] = ggt_theme_option("port_order_by" . $pf_index);    $port_args["order"] = ggt_theme_option("port_order" . $pf_index);}if ($the_query->have_posts()):    while ($the_query->have_posts()) :        $the_query->the_post();        $found = $the_query->found_posts;        if($the_query->found_posts <= $ppp){ // no more posts left for next query            $posts_left = false;        }        ?>        <div <?php post_class(); ?>>            <div class="iso_inner loading" data-id="<?php the_ID(); ?>">                <?php $thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');                $url = $thumb['0'];                ?>                <a class="portfolio_img_pop" href="<?php the_permalink(); ?>">                    <?php if(ggt_theme_option("port_square_switch" . $pf_index)): ?>                        <div class="pf_square_image" style="background-image: url(<?php echo esc_url($url); ?>)"></div>                    <?php else : ?>                        <img <?php ggt_lazy_img($url); ?> alt="<?php the_title_attribute(); ?>"  width="280" height="280"/>                    <?php endif; ?>                </a>                <div class="over_box">                    <div class="over_box_pad">                        <div class="over_box_inner">                            <?php if (ggt_theme_option('port_item_title_mod' . $pf_index) == 1) { ?>                                <span class="portfolio_name"><?php the_title(); ?></span>                            <?php } ?>                            <?php if (ggt_theme_option('port_item_desc_mod' . $pf_index) == 1) { ?>                                <span class="portfolio_desc"><?php the_time('F d, Y'); ?></span>                            <?php } ?>                            <?php if (ggt_theme_option('port_item_pp_mod') == 1) { ?>                                <?php if (ggt_theme_option('lightbox_switch') && ggt_theme_option('lightbox_switch') == 1): ?>                                    <?php if (function_exists("get_field") && ggt_get_field("youtube_link")): ?>                                        <a class="portfolio_pop"                                           rel="prettyPhoto[portfolio]"                                           href="<?php the_field("youtube_link"); ?>"><i                                                class="fa-search"></i></a>                                    <?php else: ?>                                        <a class="portfolio_pop"                                           rel="prettyPhoto[portfolio]"                                           href="<?php echo $url; ?>"><i                                                class="fa-search"></i></a>                                    <?php endif; ?>                                <?php                                else:                                    if (get_option('permalink_structure')) {                                        $ajax_string = "?sender=prettyphoto";                                    } else {                                        $ajax_string = "&sender=prettyphoto";                                    }                                    ?>                                    <a class="portfolio_pop"                                       href="<?php the_permalink(); ?><?php echo $ajax_string; ?>"><i                                            class="fa-search"></i></a>                                <?php endif; ?>                            <?php                            } else { // portfolio popup disabled, just echo permalink                                ?>                                <a class="portfolio_pop"                                   href="<?php the_permalink(); ?>">                                    <i class="fa-link"></i>                                </a>                            <?php                            }                            ?>                        </div>                    </div>                </div>            </div>        </div>        <?php if (ggt_theme_option('lightbox_switch') == 1) { ?>        <script>            (function($){                $(".over_box a").prettyPhoto({default_width: 1920, default_height: 1080});            })(jQuery);        </script>    <?php } ?>    <?php endwhile; ?>    <?php else:    $posts_left = false;endif; ?><?php wp_reset_postdata(); // reset portfolio loop ?><?php$html = ob_get_clean();echo json_encode(array("html" => $html, "postsLeft" => $posts_left));die(0);?>