<?php

/**
 * The template for displaying archive pages
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package WordPress
 */

get_header();

$description = get_the_archive_description();
?>
  <main <?php post_class('main ucla-grid container has-global-padding'); ?> id="main">
  <?php /* if (is_home() && !is_front_page() && !empty(single_post_title('', false))) : */ ?>
    <header class="ucla-content-header">
      <?php get_breadcrumbs() ?>
      <?php the_archive_title('<h1 class="headline-text__xl">', '</h1>'); ?>
        <?php if ($description) : ?>
          <div class="archive-description"><?php echo wp_kses_post(wpautop($description)); ?></div>
        <?php endif; ?>
    </header><!-- .page-header -->
    <?php /* endif; */ ?>
    <div class="ucla-content ucla-grid cols-3-md">
    <?php

      if (have_posts()) {

        // Load posts loop.
        while (have_posts()) {
          the_post();
          get_template_part('template-parts/content/content-excerpt');
        }
      } else {

        // If no content, include the "No posts found" template.
        get_template_part('template-parts/content/content-none');
      } ?>
    </div>
    <?php      
    the_posts_pagination( array(
      'type' => 'list',
      'prev_text' => '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" role="img"><title>Previous Page</title><path d="M14 18L15.41 16.59L10.83 12L15.41 7.41L14 6L8 12L14 18Z" /></svg>',
      'next_text' => '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" role="img"><title>Next Page</title><path d="M9.41 6L8 7.41L12.58 12L8 16.59L9.41 18L15.41 12L9.41 6Z" /></svg>'
    ) );
  ?>
</main>
<?php
get_footer();
