Files
homeproz/wp-content/themes/homeproz/template-resource.php
T
Hanson.xyz Dev fd0693e526 Phase 8 structural enhancements: Communities, Resources, Footer
Completed tasks:
- html-7jz: Added Communities section with landing page and community template
- html-t8u: Added Resources section with Buyer's Guide and Seller's Guide
- html-3nq: Enhanced footer with office hours, professional logos, license info

New files:
- page-communities.php: Communities landing page listing all locations
- template-community.php: Individual community page template
- page-resources.php: Resources hub with featured guides
- template-resource.php: Individual resource/guide page template
- content-communities.scss, content-resources.scss: Styles for new pages

WordPress changes:
- Created Communities page with 3 child pages (Albert Lea, Austin, Glenville)
- Created Resources page with 2 child pages (Buyer's Guide, Seller's Guide)
- Added Communities and Resources to primary navigation menu
- Added new location terms for communities

Footer enhancements:
- Office hours section (4-column grid now)
- Professional association logos (REALTOR, Equal Housing)
- License number display
2025-11-30 02:47:16 -06:00

109 lines
4.1 KiB
PHP

<?php
/**
* Template Name: Resource Page
*
* Template for individual resource/guide pages
*
* @package HomeProz
*/
// Prevent direct access
if (!defined('ABSPATH')) {
exit;
}
get_header();
?>
<main id="primary" class="site-main resource-page-main">
<?php
// Hero Section
$featured_image = get_the_post_thumbnail_url(get_the_ID(), 'full');
get_template_part('template-parts/components/hero-section', null, array(
'title' => get_the_title(),
'subtitle' => get_the_excerpt() ?: 'A comprehensive guide from HomeProz Real Estate',
'background_image' => $featured_image,
'size' => 'small',
));
?>
<!-- Resource Content Section -->
<section class="resource-content-section">
<div class="container">
<div class="resource-content-layout">
<!-- Main Content -->
<article class="resource-content">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; endif; ?>
</article>
<!-- Sidebar -->
<aside class="resource-sidebar">
<div class="resource-sidebar-sticky">
<!-- Quick Contact -->
<div class="resource-sidebar-card">
<h3>Need Help?</h3>
<p>Our agents are ready to assist you with any questions.</p>
<a href="<?php echo esc_url(home_url('/contact/')); ?>" class="btn btn-primary btn-block">
Contact Us
</a>
<p class="resource-sidebar-phone">
Or call: <a href="tel:<?php echo esc_attr(preg_replace('/[^0-9]/', '', homeproz_get_option('phone'))); ?>"><?php echo esc_html(homeproz_get_option('phone')); ?></a>
</p>
</div>
<!-- Related Resources -->
<div class="resource-sidebar-card">
<h3>Related Resources</h3>
<ul class="resource-sidebar-links">
<?php
// Get sibling pages
$parent_id = wp_get_post_parent_id(get_the_ID());
if ($parent_id) {
$siblings = get_pages(array(
'parent' => $parent_id,
'exclude' => get_the_ID(),
'sort_column' => 'menu_order',
));
foreach ($siblings as $sibling) :
?>
<li>
<a href="<?php echo esc_url(get_permalink($sibling->ID)); ?>">
<?php echo esc_html($sibling->post_title); ?>
</a>
</li>
<?php
endforeach;
}
?>
<li>
<a href="<?php echo esc_url(home_url('/resources/')); ?>">
View All Resources
</a>
</li>
</ul>
</div>
</div>
</aside>
</div>
</div>
</section>
<?php
// Contact CTA Section
get_template_part('template-parts/components/cta-section', null, array(
'title' => 'Ready to Get Started?',
'text' => 'Let our experienced team help you achieve your real estate goals.',
'button_text' => 'Contact an Agent',
'button_url' => home_url('/contact/'),
'style' => 'accent',
));
?>
</main>
<?php
get_footer();