Files
homeproz/wp-content/themes/homeproz/archive.php
T
Hanson.xyz Dev 5e2bb8585a Initialize beads issue tracking and update git policy
- Initialize beads (.beads/ directory)
- Add Claude Code hooks for SessionStart/PreCompact
- Update CLAUDE.md to clarify all build artifacts are committed
- Update .gitignore to allow node_modules and dist
2025-11-30 01:55:50 -06:00

92 lines
3.3 KiB
PHP
Executable File

<?php
/**
* The template for displaying archive pages (blog, categories, tags)
*
* @package HomeProz
*/
// Prevent direct access
if (!defined('ABSPATH')) {
exit;
}
get_header();
?>
<main id="primary" class="site-main archive-main">
<?php
// Hero Section
$archive_title = 'News & Insights';
$archive_subtitle = 'Stay informed with real estate tips, market updates, and community news';
if (is_category()) {
$archive_title = single_cat_title('', false);
$archive_subtitle = category_description();
} elseif (is_tag()) {
$archive_title = 'Tagged: ' . single_tag_title('', false);
$archive_subtitle = tag_description();
} elseif (is_author()) {
$archive_title = 'Posts by ' . get_the_author();
$archive_subtitle = get_the_author_meta('description');
} elseif (is_date()) {
if (is_year()) {
$archive_title = 'Archive: ' . get_the_date('Y');
} elseif (is_month()) {
$archive_title = 'Archive: ' . get_the_date('F Y');
} else {
$archive_title = 'Archive: ' . get_the_date();
}
}
get_template_part('template-parts/components/hero-section', null, array(
'title' => $archive_title,
'subtitle' => $archive_subtitle ?: 'Browse our articles and updates',
'size' => 'small',
));
?>
<section class="archive-content-section">
<div class="container">
<div class="archive-layout">
<!-- Main Content -->
<div class="archive-posts">
<?php if (have_posts()) : ?>
<div class="posts-grid">
<?php
while (have_posts()) :
the_post();
get_template_part('template-parts/content/content', 'card');
endwhile;
?>
</div>
<?php
// Pagination
the_posts_pagination(array(
'prev_text' => '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M19 12H5M12 19l-7-7 7-7"/></svg> Previous',
'next_text' => 'Next <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M5 12h14M12 5l7 7-7 7"/></svg>',
'mid_size' => 2,
));
?>
<?php else : ?>
<div class="no-posts-message">
<h2>No Posts Found</h2>
<p>There are no posts to display at this time. Please check back later.</p>
</div>
<?php endif; ?>
</div>
<!-- Sidebar -->
<aside class="archive-sidebar">
<?php get_template_part('template-parts/sidebar/blog-sidebar'); ?>
</aside>
</div>
</div>
</section>
</main>
<?php
get_footer();