<?php
$ekta_directory_options = ekta_directory_theme_options();

$listing_cat_show = $ekta_directory_options['listing_cat_show'];
$listing_cat_title = $ekta_directory_options['listing_cat_title'];
$listing_cat_desc = $ekta_directory_options['listing_cat_desc'];
$cat_column = $ekta_directory_options['cat_column'];
$cat_layout = $ekta_directory_options['cat_layout'];


if($listing_cat_show) { 
    if (1 == $listing_cat_show):?> 
<div class="listing-cat-wrap section">
    <div class="container">
        <div class="row">
            <?php if ($listing_cat_title || $listing_cat_desc): ?>
                <div class="section-title">
                    <?php
                    if ($listing_cat_title)
                        echo '<h2>' . esc_html($listing_cat_title) . '</h2>';
                    if ($listing_cat_desc)
                        echo '<p>' . esc_html($listing_cat_desc) . '</p>';
                    ?>
                </div>
            <?php endif; 

            if(1==$cat_column && $cat_layout=='withicon'){
            if (in_array('geodirectory/geodirectory.php', apply_filters('active_plugins', get_option('active_plugins')))) :
            echo do_shortcode('[gd_categories post_type="gd_place" hide_empty="1" max_level="1" max_count="all" max_count_child="all" title_tag="h4" hide_count="1" image_size="medium" design_type="icon-top" row_items="3" sort_by="count" mb="3"]'); 

            endif; 
        }
            elseif(1==$cat_column && $cat_layout=='withimage'){
                if (in_array('geodirectory/geodirectory.php', apply_filters('active_plugins', get_option('active_plugins')))) :
                    echo do_shortcode('[gd_categories post_type="gd_place" max_level="1" max_count="all" max_count_child="all" title_tag="h4" use_image="1" image_size="full" design_type="image" sort_by="count" row_items="3" mb="3"]'); 
        endif; 
             }

             elseif(2==$cat_column && $cat_layout=='withicon'){
                if (in_array('geodirectory/geodirectory.php', apply_filters('active_plugins', get_option('active_plugins')))) :
                    echo do_shortcode('[gd_categories post_type="gd_place" hide_empty="1" max_level="1" max_count="all" max_count_child="all" title_tag="h4" hide_count="1" image_size="medium" design_type="icon-top" row_items="4" sort_by="count" mb="3"]'); 
        
                    endif; 
             }
             elseif(2==$cat_column && $cat_layout=='withimage'){
                if (in_array('geodirectory/geodirectory.php', apply_filters('active_plugins', get_option('active_plugins')))) :
                    echo do_shortcode('[gd_categories post_type="gd_place" max_level="1" max_count="all" max_count_child="all" title_tag="h4" use_image="1" image_size="full" design_type="image" sort_by="count" row_items="4" mb="3"]'); 
        
                    endif; 
             } ?>
        </div>
    </div>
</div>

        <?php
        
    endif;
}