<html <?php echo get_language_attributes(); ?>>
<?php
global $wp_query;
$locale = get_locale();
$paged = (int) get_query_var('paged');
$news_query = new WP_Query([
  'post_type' => 'news_release',
  'tag' => 'animation-news',
  'paged' => $paged ? $paged : 1,
]);
$original_query = $wp_query;
$wp_query = $news_query;
?>
<?php echo $__env->make('partials.head', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

<body id="news" <?php body_class('renewal2023') ?>><?php wp_body_open(); ?>
  <div class="pacewrap">

    <div id="container">
      <?php echo $__env->make('partials.header', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

      <article class="mt-lg-5 pt-lg-5">
        <section class="main">

          <div class="row plr-0 pb-5 col-10 offset-1">
            <div class="container">
              <header class="post_titlearea">
                <div class="container clearfix d-flex align-items-center">
                  <h1 class="en float-left">News</h1>
              </header>

              <div id="latest_news" class="mt-md-0 border-bottom-0">
                <ul id="result" class="news-list">
                  <!-- ここに投稿を表示 -->
                  <?php if(have_posts()): while(have_posts()):the_post();$rankcount++; ?>
                  <li class="news-list__item">
                    <a class="news-list__item-inner" href="<?php echo e(get_permalink()); ?>">
                      <div class="news-list__img-wrapper">
                        <?php if(has_post_thumbnail()): ?>
                          <img class="news-list__img lazyload" src="<?php the_post_thumbnail_url('thumbnail'); ?>" data-src="<?php the_post_thumbnail_url('medium'); ?>"
                            data-srcset="<?php the_post_thumbnail_url('large'); ?> 767w, <?php the_post_thumbnail_url('large'); ?>">
                        <?php else: ?>
                          <img class="news-list__img" src="<?= App\asset_path('images/notfound.jpg'); ?>" alt="RECALM" />
                        <?php endif; ?>
                      </div>
                      <div class="news-list__text-wrapper">
                        <div class="news-list__meta">
                          <time class="news-list__date en"><?php echo e(get_the_date()); ?></time>
                          <?php
                          if('ja' == $locale && ($terms = get_the_terms($post->ID, 'ncat'))) {
                            foreach ( $terms as $term ) {
                              $term_slug = $term -> slug;
                            ?>
                          <span class="news-list__cat c_<?php echo esc_html($term_slug); ?>"><?php echo esc_html($term->name); ?>
                          </span><?php }}?>
                        </div>
                        <h2 class="news-list__title"><?php echo get_the_title(); ?></h2>
                      </div>
                    </a>
                  </li>
                  <?php if ($rankcount == $number ): ?>
                  <?php endif; ?>
                  <?php endwhile;endif; ?>
                </ul>

                <div class="news-list-pagination" id="pagination">
                  <?php the_pagination(); ?>
                </div>
                <?php
                wp_reset_postdata();
                $wp_query = $original_query;
                ?>
              </div>

            </div>
        </section>
      </article>


      <?php do_action('get_footer') ?>
      <?php echo $__env->make('partials.footer', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
      <?php wp_footer() ?>

    </div>

    <!-- Start of HubSpot Embed Code -->
    <script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/40110885.js"></script>
    <!-- End of HubSpot Embed Code -->
</body>

</html>
