23a7155955
Phase 8 P1 tasks completed: - Added location search dropdown to hero section (html-98b) - Added service cards section with Buy/Rent/Sell options (html-5bw) - Separated Featured Homes and Commercial/Land into distinct sections (html-2fp) Changes: - hero-section.php: New show_location_search option with community dropdown - service-cards.php/scss: New component with 3 service cards - front-page.php: Hero with search, service cards, separate property sections - Added community terms: Glenville, Emmons, Clarks Grove, Alden, Hartland, Geneva
274 lines
11 KiB
PHP
Executable File
274 lines
11 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* The template for displaying the homepage
|
|
*
|
|
* @package HomeProz
|
|
*/
|
|
|
|
// Prevent direct access
|
|
if (!defined('ABSPATH')) {
|
|
exit;
|
|
}
|
|
|
|
get_header();
|
|
|
|
// Get featured residential properties (3 most recent active residential listings)
|
|
$featured_residential = new WP_Query(array(
|
|
'post_type' => 'property',
|
|
'posts_per_page' => 3,
|
|
'tax_query' => array(
|
|
'relation' => 'AND',
|
|
array(
|
|
'taxonomy' => 'property_status',
|
|
'field' => 'slug',
|
|
'terms' => 'active',
|
|
),
|
|
array(
|
|
'taxonomy' => 'property_type',
|
|
'field' => 'slug',
|
|
'terms' => 'residential',
|
|
),
|
|
),
|
|
'orderby' => 'date',
|
|
'order' => 'DESC',
|
|
));
|
|
|
|
// Get featured commercial/land properties (3 most recent active commercial or land listings)
|
|
$featured_commercial = new WP_Query(array(
|
|
'post_type' => 'property',
|
|
'posts_per_page' => 3,
|
|
'tax_query' => array(
|
|
'relation' => 'AND',
|
|
array(
|
|
'taxonomy' => 'property_status',
|
|
'field' => 'slug',
|
|
'terms' => 'active',
|
|
),
|
|
array(
|
|
'taxonomy' => 'property_type',
|
|
'field' => 'slug',
|
|
'terms' => array('commercial', 'land'),
|
|
),
|
|
),
|
|
'orderby' => 'date',
|
|
'order' => 'DESC',
|
|
));
|
|
?>
|
|
|
|
<main id="primary" class="site-main homepage-main">
|
|
|
|
<?php
|
|
// Hero Section with Location Search
|
|
get_template_part('template-parts/components/hero-section', null, array(
|
|
'title' => 'Find Your Dream Home Today',
|
|
'subtitle' => 'Expert real estate services for buyers and sellers in Albert Lea and the surrounding Minnesota communities.',
|
|
'show_location_search' => true,
|
|
'primary_cta_text' => 'View All Properties',
|
|
'primary_cta_url' => home_url('/properties/'),
|
|
'secondary_cta_text' => 'Contact Us',
|
|
'secondary_cta_url' => home_url('/contact/'),
|
|
'size' => 'large',
|
|
));
|
|
|
|
// Service Cards Section (Buy/Rent/Sell)
|
|
get_template_part('template-parts/components/service-cards');
|
|
?>
|
|
|
|
<!-- Featured Residential Properties Section -->
|
|
<section class="featured-properties-section">
|
|
<div class="container">
|
|
<header class="section-header">
|
|
<h2 class="section-title">Featured Homes</h2>
|
|
<p class="section-subtitle">Browse our residential properties for sale</p>
|
|
</header>
|
|
|
|
<?php if ($featured_residential->have_posts()) : ?>
|
|
<div class="property-grid property-grid--3col">
|
|
<?php
|
|
while ($featured_residential->have_posts()) :
|
|
$featured_residential->the_post();
|
|
get_template_part('template-parts/property/property-card');
|
|
endwhile;
|
|
wp_reset_postdata();
|
|
?>
|
|
</div>
|
|
|
|
<div class="section-footer">
|
|
<a href="<?php echo esc_url(home_url('/properties/?type=residential')); ?>" class="btn btn-secondary">
|
|
View All Residential
|
|
<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>
|
|
</a>
|
|
</div>
|
|
<?php else : ?>
|
|
<p class="no-properties-message">No residential properties currently available. Please check back soon.</p>
|
|
<?php endif; ?>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- Featured Commercial & Land Properties Section -->
|
|
<section class="featured-properties-section featured-properties-section--alt">
|
|
<div class="container">
|
|
<header class="section-header">
|
|
<h2 class="section-title">Commercial & Land</h2>
|
|
<p class="section-subtitle">Explore commercial properties and land for sale</p>
|
|
</header>
|
|
|
|
<?php if ($featured_commercial->have_posts()) : ?>
|
|
<div class="property-grid property-grid--3col">
|
|
<?php
|
|
while ($featured_commercial->have_posts()) :
|
|
$featured_commercial->the_post();
|
|
get_template_part('template-parts/property/property-card');
|
|
endwhile;
|
|
wp_reset_postdata();
|
|
?>
|
|
</div>
|
|
|
|
<div class="section-footer">
|
|
<a href="<?php echo esc_url(home_url('/properties/?type=commercial,land')); ?>" class="btn btn-secondary">
|
|
View All Commercial
|
|
<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>
|
|
</a>
|
|
</div>
|
|
<?php else : ?>
|
|
<p class="no-properties-message">No commercial properties currently available. Please check back soon.</p>
|
|
<?php endif; ?>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- Why Choose Us / Features Section -->
|
|
<section class="features-section">
|
|
<div class="container">
|
|
<header class="features-section-header">
|
|
<h2 class="features-section-title">Why HomeProz?</h2>
|
|
<p class="features-section-subtitle">We're committed to helping you achieve your real estate goals</p>
|
|
</header>
|
|
|
|
<div class="features-grid">
|
|
<?php
|
|
get_template_part('template-parts/components/feature-block', null, array(
|
|
'icon' => 'local-expertise',
|
|
'title' => 'Local Expertise',
|
|
'text' => 'Deep knowledge of the Albert Lea area and surrounding Minnesota communities helps us find the perfect property for you.',
|
|
));
|
|
|
|
get_template_part('template-parts/components/feature-block', null, array(
|
|
'icon' => 'personalized',
|
|
'title' => 'Personalized Service',
|
|
'text' => 'We take the time to understand your unique needs and provide tailored guidance throughout your real estate journey.',
|
|
));
|
|
|
|
get_template_part('template-parts/components/feature-block', null, array(
|
|
'icon' => 'results',
|
|
'title' => 'Results-Driven',
|
|
'text' => 'Our track record speaks for itself. We work tirelessly to get you the best possible outcome, whether buying or selling.',
|
|
));
|
|
?>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- Team Preview Section -->
|
|
<section class="team-section">
|
|
<div class="container">
|
|
<header class="team-section-header">
|
|
<h2 class="team-section-title">Meet Our Agents</h2>
|
|
<p class="team-section-subtitle">A dedicated team of real estate professionals ready to serve you</p>
|
|
</header>
|
|
|
|
<div class="team-grid">
|
|
<?php
|
|
// Team member data - can be replaced with ACF repeater or CPT later
|
|
$team_members = array(
|
|
array(
|
|
'name' => 'Heidi Johnson',
|
|
'title' => 'REALTOR',
|
|
'phone' => '507-402-2310',
|
|
'email' => 'heidi@homeprozrealestate.com',
|
|
),
|
|
array(
|
|
'name' => 'Kyra Johnson',
|
|
'title' => 'REALTOR',
|
|
'phone' => '507-516-4870',
|
|
'email' => 'kyra@homeprozrealestate.com',
|
|
),
|
|
array(
|
|
'name' => 'John Hill',
|
|
'title' => 'REALTOR',
|
|
'phone' => '507-383-1738',
|
|
'email' => 'john@homeprozrealestate.com',
|
|
),
|
|
array(
|
|
'name' => 'Mindy Moreno',
|
|
'title' => 'REALTOR',
|
|
'phone' => '507-438-5900',
|
|
'email' => 'mindy@homeprozrealestate.com',
|
|
),
|
|
);
|
|
|
|
foreach ($team_members as $member) :
|
|
get_template_part('template-parts/components/agent-card', null, $member);
|
|
endforeach;
|
|
?>
|
|
</div>
|
|
|
|
<div class="section-footer">
|
|
<a href="<?php echo esc_url(home_url('/about/')); ?>" class="btn btn-secondary">
|
|
Learn More About Us
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- Testimonials Section -->
|
|
<section class="testimonials-section">
|
|
<div class="container">
|
|
<header class="testimonials-section-header">
|
|
<h2 class="testimonials-section-title">What Our Clients Say</h2>
|
|
<p class="testimonials-section-subtitle">Real stories from satisfied buyers and sellers</p>
|
|
</header>
|
|
|
|
<div class="testimonials-grid">
|
|
<?php
|
|
// Testimonial data - can be replaced with ACF repeater or CPT later
|
|
$testimonials = array(
|
|
array(
|
|
'quote' => 'HomeProz made our home buying experience incredibly smooth. They were patient, knowledgeable, and always available to answer our questions. We found our dream home faster than we ever expected!',
|
|
'name' => 'Sarah & Mike T.',
|
|
'location' => 'Home Buyers, Albert Lea',
|
|
),
|
|
array(
|
|
'quote' => 'Selling our home was stress-free thanks to the HomeProz team. They handled everything professionally and got us a great price. Highly recommend!',
|
|
'name' => 'Robert K.',
|
|
'location' => 'Home Seller, Austin',
|
|
),
|
|
);
|
|
|
|
foreach ($testimonials as $testimonial) :
|
|
get_template_part('template-parts/components/testimonial', null, $testimonial);
|
|
endforeach;
|
|
?>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<?php
|
|
// Contact CTA Section
|
|
get_template_part('template-parts/components/cta-section', null, array(
|
|
'title' => 'Ready to Find Your Dream Home?',
|
|
'text' => 'Whether you\'re buying or selling, our team is here to help you every step of the way.',
|
|
'button_text' => 'Contact Us Today',
|
|
'button_url' => home_url('/contact/'),
|
|
'style' => 'accent',
|
|
));
|
|
?>
|
|
|
|
</main>
|
|
|
|
<?php
|
|
get_footer();
|