40 lines
1.7 KiB
PHP
40 lines
1.7 KiB
PHP
<?php
|
|
/**
|
|
* 404
|
|
*
|
|
* @package XShop
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
get_header();
|
|
?>
|
|
<div class="xshop-container">
|
|
<div class="xshop-404">
|
|
<p class="xshop-404__code">404</p>
|
|
<h1 class="xshop-404__title"><?php esc_html_e('Page not found', 'xshop'); ?></h1>
|
|
<p class="xshop-text-muted" style="max-inline-size:48ch;margin-inline:auto"><?php esc_html_e('The page you are looking for does not exist. Try searching or return home.', 'xshop'); ?></p>
|
|
<div style="margin-block-start:var(--xshop-space-6);display:flex;gap:var(--xshop-space-3);justify-content:center;flex-wrap:wrap">
|
|
<a class="xshop-btn xshop-btn--primary" href="<?php echo esc_url(home_url('/')); ?>"><?php esc_html_e('Go home', 'xshop'); ?></a>
|
|
</div>
|
|
<div style="max-inline-size:520px;margin-inline:auto;margin-block-start:var(--xshop-space-8)">
|
|
<?php get_template_part('template-parts/components/search-form', null, ['placeholder'=>esc_html__('Search…','xshop')]); ?>
|
|
</div>
|
|
|
|
<?php
|
|
$recent = new WP_Query(['post_type'=>'post','posts_per_page'=>3,'no_found_rows'=>true]);
|
|
if ($recent->have_posts()):
|
|
?>
|
|
<section class="xshop-section" aria-labelledby="xshop-404-recent">
|
|
<h2 id="xshop-404-recent" class="xshop-section__title" style="font-size:var(--xshop-text-xl)"><?php esc_html_e('Recent posts', 'xshop'); ?></h2>
|
|
<div class="xshop-grid xshop-grid--posts" style="margin-block-start:var(--xshop-space-4);text-align:start">
|
|
<?php while ($recent->have_posts()): $recent->the_post(); get_template_part('template-parts/components/post-card'); endwhile; wp_reset_postdata(); ?>
|
|
</div>
|
|
</section>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
<?php get_footer(); ?>
|