<?php
$ekta_directory_options = ekta_directory_theme_options();

$listing_item_show = $ekta_directory_options['listing_item_show'];
$listing_item_title = $ekta_directory_options['listing_item_title'];
$listing_item_desc = $ekta_directory_options['listing_item_desc'];
$listing_column = $ekta_directory_options['listing_column'];


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

            if('3column'==$listing_column){
                if (in_array('geodirectory/geodirectory.php', apply_filters('active_plugins', get_option('active_plugins')))) :
                    echo do_shortcode('[gd_listings post_type="gd_place" post_limit="6" add_location_filter="1" sort_by="az" title_tag="h3" layout="3" bottom_pagination="1" mb="3"]'); 
                endif; 
            }
            elseif('2column'==$listing_column){
                if (in_array('geodirectory/geodirectory.php', apply_filters('active_plugins', get_option('active_plugins')))) :
                    echo do_shortcode('[gd_listings post_type="gd_place" post_limit="6" add_location_filter="1" sort_by="az" title_tag="h3" layout="2" bottom_pagination="1" mb="3"]'); 
                endif; 
            }
            elseif('4column'==$listing_column){
                if (in_array('geodirectory/geodirectory.php', apply_filters('active_plugins', get_option('active_plugins')))) :
                    echo do_shortcode('[gd_listings post_type="gd_place" post_limit="8" add_location_filter="1" sort_by="az" title_tag="h3" layout="4" bottom_pagination="1" mb="3"]'); 
                endif; 
            }
             ?>
        </div>
    </div>
</div>

        <?php
        
    endif;
}