<?php /*template name: Brands*/ get_header(); ?>

<div class="uk-cover-container uk-text-center banner uk-margin-large-bottom" uk-scrollspy="cls: uk-animation-fade; delay: 300">
    <canvas class="uk-visible@m" width="" height="200"></canvas>
    <canvas class="uk-hidden@m" width="" height="200"></canvas>

	<img uk-img data-src="<?php echo get_template_directory_uri(); ?>/images/commercial-refrigerators-at-a-grocery-store.webp" data-width data-height uk-cover>

	<div class="uk-position-cover uk-text-center uk-container uk-flex uk-flex-center uk-flex-middle" uk-scrollspy="cls: uk-animation-fade; delay: 500">
      <div>
				<h1 class="white uk-text-center"><?php the_title(); ?></h1>

      </div>
  </div>
</div>


<div class="uk-container" uk-scrollspy="cls: uk-animation-fade; delay: 300">
	<main role="main">
		<section>


			<?php if (have_posts()): while (have_posts()) : the_post(); ?>

				<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

					<?php the_content(); ?>

					<ul class="uk-child-width-1-2 uk-child-width-1-6@m uk-grid-small uk-flex uk-flex-middle" uk-grid uk-scrollspy="target: > li; cls: uk-animation-fade; delay: 300">
                  <?php
                    $args = array(
                    'post_type'      => 'brands',
                    'posts_per_page' => 999,
                    'orderby' => 'title',
                    'order'   => 'ASC',

                );

                $loop = new WP_Query($args);

                if ($loop->have_posts()) {
                    while ($loop->have_posts()) : $loop->the_post();?>
                    <li>
                      <div class=" services-box">
                        <?php if ( has_post_thumbnail() ) { ?>

                					<img uk-img data-src="<?php the_post_thumbnail_url('full'); ?>" data-width data-height>

                    		<?php } else { ?>
                    		<?php } ?>

                  </div>
                </li>
                <?php endwhile;
            } else {
                echo __('No products found');
            }

            wp_reset_postdata();
            ?>
          </ul>

					<br class="clear">

					<p class="uk-text-right"><?php edit_post_link( __('Edit this page'), '', '', 0, 'post-edit-link uk-text-large uk-padding-small uk-button-large uk-button uk-button-primary' ); ?></p>

				</article>

			<?php endwhile; ?><?php endif; ?>

		</section>
	</main>
</div>
<?php get_footer(); ?>
