2024-06-20 07:22:10 +00:00
< ? php get_header (); ?>
<!-- Hero Section -->
< section class = " hero text-center text-white d-flex align-items-center " style = " background-image: url('<?php echo get_theme_mod('hero_image', get_template_directory_uri() . '/assets/img/hero.png'); ?>'); " >
< div class = " container " >
< h1 class = " display-4 " >< ? php echo get_theme_mod ( 'hero_title' , 'Advancing the Understanding of Duck Behavior' ); ?> </h1>
< p class = " lead " >< ? php echo get_theme_mod ( 'hero_subtitle' , 'Through Rigorous Scientific Research' ); ?> </p>
< a href = " <?php echo get_theme_mod('hero_primary_button_url', '#'); ?> " class = " btn btn-primary " >< ? php echo get_theme_mod ( 'hero_primary_button_text' , 'Submit Your Research' ); ?> </a>
< a href = " <?php echo get_theme_mod('hero_secondary_button_url', '#'); ?> " class = " btn btn-secondary " >< ? php echo get_theme_mod ( 'hero_secondary_button_text' , 'Subscribe to the Journal' ); ?> </a>
</ div >
</ section >
<!-- Featured Articles -->
< section class = " container my-5 " >
< h2 class = " text-center mb-4 " > Featured Articles </ h2 >
< div class = " row " >
< ? php
2024-06-20 08:52:49 +00:00
$args = array ( 'post_type' => 'article' , 'posts_per_page' => 3 );
2024-06-20 07:22:10 +00:00
$loop = new WP_Query ( $args );
while ( $loop -> have_posts ()) : $loop -> the_post ();
?>
< div class = " col-md-4 " >
< div class = " card mb-4 shadow-sm " >
< ? php if ( has_post_thumbnail ()) : ?>
2024-06-20 12:52:37 +00:00
< a href = " <?php the_permalink(); ?> " >
< img src = " <?php the_post_thumbnail_url(); ?> " class = " card-img-top " alt = " <?php the_title(); ?> " >
</ a >
2024-06-20 07:22:10 +00:00
< ? php endif ; ?>
< div class = " card-body " >
2024-06-20 12:52:37 +00:00
< a href = " <?php the_permalink(); ?> " >
< h5 class = " card-title " >< ? php the_title (); ?> </h5>
</ a >
2024-06-20 08:52:49 +00:00
< p class = " card-text " >
< ? php
$authors = get_post_meta ( get_the_ID (), 'article_authors' , true );
if ( ! empty ( $authors )) {
echo esc_html ( $authors [ 0 ]);
if ( count ( $authors ) > 1 ) {
echo ' et al.' ;
}
} else {
the_author ();
}
2024-06-20 09:10:31 +00:00
?>
2024-06-20 08:52:49 +00:00
</ p >
2024-06-20 09:10:31 +00:00
< p class = " card-text " >< ? php the_excerpt (); ?> </p>
2024-06-20 09:28:29 +00:00
< p class = " card-text " >
2024-08-03 15:12:13 +00:00
< ? php display_publication_status_terms ( get_the_ID ()); ?>
2024-06-20 09:38:24 +00:00
</ p >
< a href = " <?php the_permalink(); ?> " class = " btn btn-outline-primary " > Read More </ a >
2024-06-20 07:22:10 +00:00
</ div >
</ div >
</ div >
< ? php endwhile ;
wp_reset_query (); ?>
</ div >
2024-06-20 13:30:57 +00:00
< div class = " text-center mt-4 " >
< a href = " <?php echo get_post_type_archive_link('article'); ?> " class = " btn btn-lg btn-primary " > View All Articles </ a >
</ div >
2024-06-20 07:22:10 +00:00
</ section >
< ? php get_footer (); ?>