Add core 404, search, and archive standard templates

This commit is contained in:
Adolfo Reyna
2026-03-13 00:44:29 -04:00
parent 85ad93a6fa
commit 1177b0ca47
3 changed files with 133 additions and 0 deletions

32
404.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
/**
* The template for displaying 404 pages (not found)
*/
get_header();
?>
<main id="primary" class="site-main container text-center my-5 py-5">
<section class="error-404 not-found d-flex flex-column align-items-center justify-content-center"
style="min-height: 50vh;">
<h1 class="display-1 fw-bold font-serif text-primary mb-3">404</h1>
<h2 class="h3 font-sans mb-4">Page Not Found</h2>
<p class="lead text-muted font-sans mb-5 w-75 mx-auto">
<?php esc_html_e('It looks like nothing was found at this location. Perhaps searching can help.', 'wisdom1'); ?>
</p>
<div class="search-container w-100" style="max-width: 500px;">
<?php get_search_form(); ?>
</div>
<div class="mt-5">
<a href="<?php echo esc_url(home_url('/')); ?>"
class="btn btn-secondary btn-lg px-4 fs-6 text-uppercase fw-bold rounded-pill shadow-sm">
Return to Home
</a>
</div>
</section><!-- .error-404 -->
</main><!-- #main -->
<?php
get_footer();

47
archive.php Normal file
View File

@@ -0,0 +1,47 @@
<?php
/**
* The template for displaying standard archive pages
*/
get_header(); ?>
<div class="bg-light py-5 border-bottom mb-5">
<div class="container text-center">
<h1 class="display-5 fw-bold mb-3">
<?php the_archive_title(); ?>
</h1>
<?php if (get_the_archive_description()): ?>
<div class="lead text-muted mx-auto w-75">
<?php the_archive_description(); ?>
</div>
<?php endif; ?>
</div>
</div>
<div class="container mb-5">
<main id="primary" class="site-main">
<div class="row g-4">
<?php
if (have_posts()):
while (have_posts()):
the_post();
get_template_part('template-parts/content', 'card');
endwhile;
echo '</div>'; // close row
the_posts_navigation(array(
'screen_reader_text' => 'Posts navigation',
'prev_text' => '<span class="btn btn-outline-primary">&larr; Older Posts</span>',
'next_text' => '<span class="btn btn-outline-primary">Newer Posts &rarr;</span>',
'class' => 'd-flex justify-content-between my-5'
));
else:
echo '<div class="col-12"><div class="alert alert-info text-center">' . esc_html__('No archives found.', 'wisdom1') . '</div></div></div>'; // close row and alert
endif;
?>
</main>
</div>
<?php
get_footer();

54
search.php Normal file
View File

@@ -0,0 +1,54 @@
<?php
/**
* The template for displaying search results pages
*/
get_header();
?>
<div class="bg-light py-5 border-bottom mb-5">
<div class="container text-center">
<h1 class="display-5 fw-bold mb-3">
<?php
/* translators: %s: search query. */
printf(esc_html__('Search Results for: %s', 'wisdom1'), '<span>' . get_search_query() . '</span>');
?>
</h1>
</div>
</div>
<main id="primary" class="site-main container mb-5">
<div class="row g-4">
<?php if (have_posts()): ?>
<?php
/* Start the Loop */
while (have_posts()):
the_post();
get_template_part('template-parts/content', 'card');
endwhile;
the_posts_navigation(array(
'screen_reader_text' => 'Posts navigation',
'prev_text' => '<span class="btn btn-outline-primary">&larr; Older Results</span>',
'next_text' => '<span class="btn btn-outline-primary">Newer Results &rarr;</span>',
'class' => 'd-flex justify-content-between my-5 col-12'
));
else:
?>
<div class="col-12 text-center py-5">
<h2 class="h3 mb-4">Nothing Found</h2>
<p class="lead text-muted mb-4">Sorry, but nothing matched your search terms. Please try again with some
different keywords.</p>
<div class="search-container mx-auto" style="max-width: 500px;">
<?php get_search_form(); ?>
</div>
</div>
<?php
endif;
?>
</div><!-- .row -->
</main><!-- #main -->
<?php
get_footer();