64 lines
2.1 KiB
PHP
64 lines
2.1 KiB
PHP
<?php
|
|
get_header();
|
|
|
|
// The Customizer stores a media attachment ID; resolve it only for the front-page hero.
|
|
$video_id = absint( get_theme_mod( 'c1024_2026_hero_video' ) );
|
|
$video_url = $video_id ? wp_get_attachment_url( $video_id ) : '';
|
|
$hero_title = get_theme_mod( 'c1024_2026_hero_title', get_bloginfo( 'name' ) );
|
|
$hero_text = get_theme_mod( 'c1024_2026_hero_text' );
|
|
// The site subtitle complements the Customizer-controlled hero headline.
|
|
$site_description = get_bloginfo( 'description', 'display' );
|
|
|
|
// Keep the hero available for text-only configurations when no video is selected.
|
|
if ( $video_url || $hero_title || $hero_text ) {
|
|
?>
|
|
<section class="hero" aria-label="<?php esc_attr_e( 'Introduction', 'c1024-2026' ); ?>">
|
|
<?php if ( $video_url ) { ?>
|
|
<video class="hero-video" autoplay muted loop playsinline>
|
|
<source src="<?php echo esc_url( $video_url ); ?>" type="<?php echo esc_attr( get_post_mime_type( $video_id ) ); ?>">
|
|
</video>
|
|
<?php } ?>
|
|
<div class="hero-content">
|
|
<?php if ( $site_description ) { ?>
|
|
<div class="hero-eyebrow"><?php echo esc_html( $site_description ); ?></div>
|
|
<?php } ?>
|
|
<?php if ( $hero_title ) { ?>
|
|
<h1 class="hero-title"><?php echo esc_html( $hero_title ); ?></h1>
|
|
<?php } ?>
|
|
<?php if ( $hero_text ) { ?>
|
|
<p class="hero-text"><?php echo esc_html( $hero_text ); ?></p>
|
|
<?php } ?>
|
|
</div>
|
|
</section>
|
|
<?php
|
|
}
|
|
?>
|
|
<main id="main" class="site-main">
|
|
<?php
|
|
// On a static front page, is_home() identifies the separate posts index; it uses archive cards.
|
|
if ( is_home() ) {
|
|
if ( have_posts() ) {
|
|
while ( have_posts() ) {
|
|
the_post();
|
|
get_template_part( 'template-parts/content' );
|
|
}
|
|
|
|
the_posts_pagination( array( 'mid_size' => 1 ) );
|
|
}
|
|
} else {
|
|
while ( have_posts() ) {
|
|
the_post();
|
|
?>
|
|
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
|
<div class="entry-content"><?php the_content(); ?></div>
|
|
</article>
|
|
<?php
|
|
if ( comments_open() || get_comments_number() ) {
|
|
comments_template();
|
|
}
|
|
}
|
|
}
|
|
?>
|
|
</main>
|
|
<?php get_footer();
|