<?php
$category   = isset($args['category']) ? $args['category'] : '';
$class      = isset($args['class']) ? $args['class'] : '';

$args = array(
    'post_type'           => 'banner_logos',
    'post_status'         => 'publish',
    'ignore_sticky_posts' => 1,
    'posts_per_page'      =>-1,
    'orderby'             => 'ASC',
    'order'               => 'ASC',
    'tax_query'           => array(array(
        'taxonomy'      => 'banner_logos_categories',
        'field'         => 'slug', //This is optional, as it defaults to 'term_id'
        'terms'         => $category ? $category : 'default',
        'operator'      => 'IN' // Possible values are 'IN', 'NOT IN', 'AND'.
    ))
);

$the_query = new WP_Query( $args );
?>

<section class="section banner-logos <?php echo $class;?>">
    <div class="container relative">
        <div class="box">
            <div class="owl-carousel owl-theme banner-logos-slider">
            <?php
                if ($the_query->found_posts!=0)
                {
                   
                    while ( $the_query->have_posts() ) : $the_query->the_post();
                        $post_id=get_the_ID();
                        $title  = get_the_title();
                        $content = get_the_content(); 
                        $rating_number = get_field('ratings_number'); 
                        $featured_image = get_the_post_thumbnail($post_id, 'full', ['class' => 'img-fluid', 'loading' => 'lazy']); 
                ?>
                <div class="item">
                    <span class="img-cont" target="_blank">
                        <div class="top">
                            <?php echo $featured_image ?>
                        </div>                        
                    </span>
                </div>
                <?php
                      
                    endwhile;
                    wp_reset_postdata();
                    wp_reset_query();
                }
                ?>
            </div>
        </div>
    </div>
</section>