Sindbad~EG File Manager

Current Path : /var/www/html/forumdainovacaors.com.br/wp-content/themes/itt/lists/
Upload File :
Current File : /var/www/html/forumdainovacaors.com.br/wp-content/themes/itt/lists/list-empresas.php

<?php
$showAll = $_GET['showAll'];
$posts_per_page = -1;
  
$query_args = array(
  'post_type' => 'empresas',
  'post_status' => 'publish',
  'posts_per_page' => $posts_per_page,
  'orderby'	=> 'title',
  'order'	=> 'ASC',
);

if (get_query_var('term')) {
    $query_args['tax_query'] = array(
    array(
      'taxonomy' => 'category_companies',
      'field'    => 'slug',
      'terms'    => get_query_var('term'),
    ),
  );
}

$the_query = new WP_Query($query_args);
$empresas = array();

while ($the_query->have_posts()) {
    $the_query->the_post();
    $empresas[] = array(
    'id' => $post->ID,
    'title' => get_the_title(),
    'description' => get_field('description'),
    'date' => get_the_date('Y-m-d'),
    'phone' => get_field('phone'),
    'email' => get_field('email'),
    'site' => get_field('site'),
    'link' => get_post_permalink(),
    'img' => get_the_post_thumbnail_url(),
  );
}

?>

<?php
  set_query_var('title', __('Empresas', 'itt'));
  get_template_part('components/item', 'head-page');
  get_template_part('components/item', 'card-empresas');
?>
<section class="list">
  <div class="container mt-4 mb-4">
    <div class="empresas list-empresas row" h-list=30>
      <?php if (count($empresas) > 0):?>
      <?php foreach ($empresas as $key => $row):?>
          <div class="col col-sm-3">
            <?php
              set_query_var('empresa', $row);
              get_template_part('components/item', 'card-empresas');
            ?>
          </div>
      <?php endforeach; ?>
    </div>
    <?php else: ?>
      <div class="col-sm-12 mb-2">
        <div class="card card-horizontal not-click">
          <div class="card-body">
            <div class="row">
              <div class="col-md-10">
                <div class="row">
                  <div class="col-md-12 d-flex">
                  </div>
                  <div class="col-md-10">
                    <?php echo _e('Nenhum resultado encontrado', 'itt'); ?>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div> 
    <?php endif ?>
      </div>
      <div class="col-sm-4 order-md-2 order-1">
        <a class=" btn-show-more w-100" href="?showAll=true#showmore">
          <!-- <img src="<?php //echo get_template_directory_uri();?>/public/assets/images/plus-sign-to-add.svg" /> -->
        </a>
      </div>
    </div>
  </div>
</section>
 


Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists