<?php
/**
 * Generated by blog pipeline.
 */
get_header();
?>
<?php
	if ( ! defined( 'ABSPATH' ) ) {
		exit;
	}

	$page_id = get_queried_object_id();

	$short_description = get_post_meta(
		$page_id,
		'short_description',
		true
	);
?>
<header class="g-c516fcc6" data-module-config="99a8be056" data-bs-target="b70f4dbfaf" data-bs-dismiss="77b5fdedef" data-mui-toggle="popover" data-analytics-automation="0c37ca">
	<?php if ( has_post_thumbnail( $page_id ) ) : ?>
		<div class="g-c28a4f26" id="elem-1683bdd0c458bc7f">
			<figure class="g-d0f9b159 g-1252e9a0 g-aa2906c8">
				<?php
					echo get_the_post_thumbnail(
						$page_id,
						'',
						[
							'loading' => 'eager',
						]
					);
				?>
			</figure>
		</div>
	<?php endif; ?>
	<div class="g-02929f7e" data-mui-slide-to="ad7007526" data-analytics-ride="8c604dfb5b" data-mui-loading="be91d74bd97d" data-test-locator="ef587e798" data-component-variant="outlined">
		<div class="g-a5203071" id="elem-ff41329f9fb53801">
			<h1 class="g-14906360 g-4d7b4f87" data-mui-value="911be504f60" data-block-state="inactive">
				<?php echo esc_html( get_bloginfo( 'name' ) ); ?>
			</h1>
			<?php if ( ! empty( $short_description ) ) : ?>
				<div class="g-4741c75e g-f37e2952 g-fc8ad3ad" id="elem-0b1cccc9c45716c5">
					<?php echo esc_html( $short_description ); ?>
				</div>
			<?php endif; ?>
			<div class="g-cdf70468 g-8dd0b5fd" data-bs-fixture="153580" data-element-priority="medium">
				<?php get_template_part( 'templates/searchform' ); ?>
			</div>
		</div>
	</div>
</header>

<section class="g-716460a1" aria-labelledby="faq-title">
    <div class="g-63e2c1ff">
        <div class="g-b82fd242">
            <header class="g-d9d1c52d">
                <h2 id="faq-title" class="g-4d7b4f87 g-1eebabcc">Common Questions from Home Gardeners</h2>
                <p class="g-972e0058 g-1eebabcc">
                    
                </p>
            </header>
            <ul class="g-9f0c0dfb g-8cdd9402 g-2adec28b g-3eaa23da g-4d976e7e" role="list">
                <li role="listitem" class="g-dff21cbb">
                    <details class="g-b5c8e424 g-327b0b43 g-3eaa23da g-2bbcb7bb">
                        <summary class="g-1ed60597 g-c7fe552c g-1eebabcc">
                            What is the best time to plant flowers?
                            <span class="g-0a5797fe" aria-hidden="true">
                                <svg width="22" height="22" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
                                    <path fill-rule="evenodd" clip-rule="evenodd"
                                          d="M11 22C10.4477 22 10 21.5523 10 21L10 12L0.999999 12C0.447715 12 -9.13368e-07 11.5523 -9.61651e-07 11C-1.00993e-06 10.4477 0.447715 10 0.999999 10L10 10L10 0.999999C10 0.447715 10.4477 -8.97416e-07 11 -9.45698e-07C11.5523 -9.9398e-07 12 0.447715 12 0.999999L12 10L21 10C21.5523 10 22 10.4477 22 11C22 11.5523 21.5523 12 21 12L12 12L12 21C12 21.5523 11.5523 22 11 22Z"/>
                                </svg>
                            </span>
                        </summary>
                        <div class="g-a01865fb g-8cdd9402 g-38d13b35">
                            Planting times depend on flower type and climate. Many flowers go in after the last frost, but some prefer cooler seasons. Check regional guides for specific timing.
                        </div>
                    </details>
                </li>
                <li role="listitem" class="g-dff21cbb">
                    <details class="g-b5c8e424 g-327b0b43 g-3eaa23da g-2bbcb7bb">
                        <summary class="g-1ed60597 g-c7fe552c g-1eebabcc">
                            How often should I water my flower garden?
                            <span class="g-0a5797fe" aria-hidden="true">
                                <svg width="22" height="22" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
                                    <path fill-rule="evenodd" clip-rule="evenodd"
                                          d="M11 22C10.4477 22 10 21.5523 10 21L10 12L0.999999 12C0.447715 12 -9.13368e-07 11.5523 -9.61651e-07 11C-1.00993e-06 10.4477 0.447715 10 0.999999 10L10 10L10 0.999999C10 0.447715 10.4477 -8.97416e-07 11 -9.45698e-07C11.5523 -9.9398e-07 12 0.447715 12 0.999999L12 10L21 10C21.5523 10 22 10.4477 22 11C22 11.5523 21.5523 12 21 12L12 12L12 21C12 21.5523 11.5523 22 11 22Z"/>
                                </svg>
                            </span>
                        </summary>
                        <div class="g-a01865fb g-8cdd9402 g-38d13b35">
                            Watering needs vary by plant, soil, and weather. Generally, it&#039;s better to water deeply and less frequently to encourage strong root growth. Monitor soil moisture to adjust.
                        </div>
                    </details>
                </li>
                <li role="listitem" class="g-dff21cbb">
                    <details class="g-b5c8e424 g-327b0b43 g-3eaa23da g-2bbcb7bb">
                        <summary class="g-1ed60597 g-c7fe552c g-1eebabcc">
                            What are some easy flowers for beginners?
                            <span class="g-0a5797fe" aria-hidden="true">
                                <svg width="22" height="22" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
                                    <path fill-rule="evenodd" clip-rule="evenodd"
                                          d="M11 22C10.4477 22 10 21.5523 10 21L10 12L0.999999 12C0.447715 12 -9.13368e-07 11.5523 -9.61651e-07 11C-1.00993e-06 10.4477 0.447715 10 0.999999 10L10 10L10 0.999999C10 0.447715 10.4477 -8.97416e-07 11 -9.45698e-07C11.5523 -9.9398e-07 12 0.447715 12 0.999999L12 10L21 10C21.5523 10 22 10.4477 22 11C22 11.5523 21.5523 12 21 12L12 12L12 21C12 21.5523 11.5523 22 11 22Z"/>
                                </svg>
                            </span>
                        </summary>
                        <div class="g-a01865fb g-8cdd9402 g-38d13b35">
                            Several flowers are known for being low-maintenance, such as marigolds, sunflowers, and pansies. They tend to tolerate a range of conditions and require minimal care, making them ideal for novices.
                        </div>
                    </details>
                </li>
                <li role="listitem" class="g-dff21cbb">
                    <details class="g-b5c8e424 g-327b0b43 g-3eaa23da g-2bbcb7bb">
                        <summary class="g-1ed60597 g-c7fe552c g-1eebabcc">
                            How can I improve the soil for planting flowers?
                            <span class="g-0a5797fe" aria-hidden="true">
                                <svg width="22" height="22" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
                                    <path fill-rule="evenodd" clip-rule="evenodd"
                                          d="M11 22C10.4477 22 10 21.5523 10 21L10 12L0.999999 12C0.447715 12 -9.13368e-07 11.5523 -9.61651e-07 11C-1.00993e-06 10.4477 0.447715 10 0.999999 10L10 10L10 0.999999C10 0.447715 10.4477 -8.97416e-07 11 -9.45698e-07C11.5523 -9.9398e-07 12 0.447715 12 0.999999L12 10L21 10C21.5523 10 22 10.4477 22 11C22 11.5523 21.5523 12 21 12L12 12L12 21C12 21.5523 11.5523 22 11 22Z"/>
                                </svg>
                            </span>
                        </summary>
                        <div class="g-a01865fb g-8cdd9402 g-38d13b35">
                            Soil improvement often involves adding organic matter like compost or aged manure, which enhances drainage and nutrient content. Testing soil pH can also guide necessary adjustments.
                        </div>
                    </details>
                </li>
                <li role="listitem" class="g-dff21cbb g-74d6d011">
                    <details class="g-b5c8e424 g-327b0b43 g-3eaa23da g-2bbcb7bb">
                        <summary class="g-1ed60597 g-c7fe552c g-1eebabcc">
                            What are some basic principles of flower garden design?
                            <span class="g-0a5797fe" aria-hidden="true">
                                <svg width="22" height="22" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
                                    <path fill-rule="evenodd" clip-rule="evenodd"
                                          d="M11 22C10.4477 22 10 21.5523 10 21L10 12L0.999999 12C0.447715 12 -9.13368e-07 11.5523 -9.61651e-07 11C-1.00993e-06 10.4477 0.447715 10 0.999999 10L10 10L10 0.999999C10 0.447715 10.4477 -8.97416e-07 11 -9.45698e-07C11.5523 -9.9398e-07 12 0.447715 12 0.999999L12 10L21 10C21.5523 10 22 10.4477 22 11C22 11.5523 21.5523 12 21 12L12 12L12 21C12 21.5523 11.5523 22 11 22Z"/>
                                </svg>
                            </span>
                        </summary>
                        <div class="g-a01865fb g-8cdd9402 g-38d13b35">
                            Design considerations include plant height, color, bloom time, and spacing. Grouping plants with similar needs and creating focal points can result in a cohesive and attractive garden.
                        </div>
                    </details>
                </li>
            </ul>
        </div>
    </div>
</section>

<section class="g-9fea409a" data-test-selector="b588107b44" data-section-config="99975e87e89" data-analytics-selector="9d1f3c2efb" data-block-position="bottom">
    <div class="g-63e2c1ff" id="elem-f4fb1349ac0dbc78">
        <h2 class="g-4d7b4f87 g-9f89f62c" data-element-size="xl" data-analytics-category="commerce" data-element-position="center">All categories</h2>
        <div class="g-14fbeec2" id="elem-0cdc006d5bbe5d0e">
            <?php
                $categories = get_categories(
                    [
                        'orderby'    => 'count',
                        'order'      => 'DESC',
                        'hide_empty' => true,
                    ]
                );

                if ( $categories ) :
                    ?>
                    <?php foreach ( $categories as $category ) : ?>
                    <?php $icon = get_term_meta( $category->term_id, 'icon', true ); ?>
                    <a
                        href="<?php echo esc_url( get_category_link( $category->term_id ) ); ?>"
                        class="g-da80ce59"
                    >
                        <?php if ( ! empty( $icon ) ) : ?>
                            <span class="g-31638a89 g-4d7b4f87">
                                <?php echo esc_html( $icon ); ?>
                            </span>
                        <?php endif; ?>
                        <span class="g-87830659 g-c7fe552c">
                            <?php echo esc_html( $category->name ); ?>
                        </span>
                    </a>
                <?php endforeach; ?>
                <?php endif; ?>
        </div>
    </div>
</section>

<?php

	if ( ! defined( 'ABSPATH' ) ) {
		exit;
	}
	/**
	 * Popular post
	 */
	$popular_posts = get_posts(
		[
			'post_type'           => 'post',
			'posts_per_page'      => 1,
			'meta_key'            => 'is_popular',
			'meta_value'          => '1',
			'ignore_sticky_posts' => true,
		]
	);
	/**
	 * Latest posts
	 */
	$latest_posts = get_posts(
		[
			'post_type'           => 'post',
			'posts_per_page'      => 4,
			'post_status'         => 'publish',
			'ignore_sticky_posts' => true,
			'post__not_in'        => ! empty( $popular_posts )
				? [ $popular_posts[0]->ID ]
				: [],
		]
	);

?>
<section class="g-bb62e631" data-test-action="hover" data-widget-animation="slide">
	<div class="g-63e2c1ff" id="elem-5f705be292c41e6f">
		<div class="g-a3a85bbf" data-component-category="commerce" data-analytics-slide-to="1972aebdc1e">
			<?php if ( ! empty( $popular_posts ) ) : ?>
				<div
					class="g-9941a29b"
					aria-labelledby="popular-post-title"
				>
					<div class="g-a2bd56cf" id="elem-707f82a1e0380d81">
						<h2
							id="popular-post-title"
							class="g-a2201725 g-4d7b4f87"
							data-block-group="ab06b519f491" data-component-role="footer" data-bs-keyboard="0b9bc7bc7000"
						>
							Popular posts
						</h2>
					</div>
					<div class="g-dbbf13ed g-8dd0b5fd" id="elem-29c530a981d36493">
						<?php
							$post = $popular_posts[0];
							setup_postdata( $post );
							get_template_part(
								'templates/post-card',
								null,

							);
							wp_reset_postdata();
						?>
					</div>
				</div>
			<?php endif; ?>
			<?php if ( ! empty( $latest_posts ) ) : ?>
				<aside
					class="g-8f9fa1c7"
					aria-labelledby="latest-posts-title"
				>
					<div class="g-8d24ba3c" data-block-group="95b0968fb" data-block-position="top" data-bs-category="error">
						<h2
							id="latest-posts-title"
							class="g-a2201725 g-4d7b4f87"
							id="elem-ff84631aa944f6bc"
						>
						Latest posts
						</h2>
					</div>
					<div class="g-3a8e14db g-8dd0b5fd" data-component-group="d752647e8" data-block-mode="disabled" data-analytics-track="e56fa6" data-analytics-interval="e52904e6ebcf">
						<?php
							foreach ( $latest_posts as $post ) :
								setup_postdata( $post );
								?>
								<?php
								get_template_part(
									'templates/post-card',
									null,
									[
										'size' => 'small',
									]
								);
								?>
							<?php
							endforeach;
							wp_reset_postdata();
						?>
					</div>
				</aside>
			<?php endif; ?>
		</div>
		<?php
			$posts_page_id = get_option( 'page_for_posts' );

			if ( $posts_page_id ) :
				?>
				<div class="g-59b3e5a5" data-widget-mode="edit" data-mui-automation="670183" data-component-variant="contained" data-test-source="de09865" data-mui-target="0395a93e">
					<a href="<?php echo esc_url( get_permalink( $posts_page_id ) ); ?>" class="g-1efedfb7" id="elem-0ab6f62aba52ad7c">
						<span>View all</span>
					</a>
				</div>
			<?php endif; ?>
	</div>
</section>

<?php
	if ( ! defined( 'ABSPATH' ) ) {
		exit;
	}

	$render_page_content = static function ( string $content ): void {
		if ( $content === '' ) {
			return;
		}
		?>
		<div class="g-63e2c1ff">
			<article id="post-<?php the_ID(); ?>" class="content-wrapper g-c744c55b">
				<?php echo apply_filters( 'the_content', $content ); ?>
			</article>
		</div>
		<?php
	};

	if ( in_the_loop() ) {
		$render_page_content( get_the_content() );
	} elseif ( have_posts() ) {
		while ( have_posts() ) {
			the_post();
			$render_page_content( get_the_content() );
		}
	}
?>
<?php get_footer(); ?>
