37 lines
1.2 KiB
PHP
37 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* Archive
|
|
*
|
|
* @package XShop
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
get_header();
|
|
?>
|
|
<div class="xshop-container">
|
|
<div class="xshop-layout">
|
|
<div class="xshop-layout__content">
|
|
<header class="xshop-page-header">
|
|
<?php the_archive_title('<h1 class="xshop-page-header__title">', '</h1>'); ?>
|
|
<?php $desc = get_the_archive_description(); if ($desc !== ''): ?>
|
|
<div class="xshop-page-header__desc"><?php echo wp_kses_post($desc); ?></div>
|
|
<?php endif; ?>
|
|
</header>
|
|
|
|
<?php if (have_posts()): ?>
|
|
<div class="xshop-grid xshop-grid--posts">
|
|
<?php while (have_posts()): the_post(); get_template_part('template-parts/components/post-card'); endwhile; ?>
|
|
</div>
|
|
<?php get_template_part('template-parts/components/pagination'); ?>
|
|
<?php else: ?>
|
|
<?php get_template_part('template-parts/components/empty-state', null, ['title'=>esc_html__('Nothing here','xshop'),'text'=>esc_html__('No posts found in this archive.','xshop'),'cta_label'=>esc_html__('Go home','xshop'),'cta_url'=>home_url('/')]); ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
<?php get_sidebar(); ?>
|
|
</div>
|
|
</div>
|
|
<?php get_footer(); ?>
|