2024-06-20 18:53:04 +00:00
|
|
|
<?php get_header(); ?>
|
|
|
|
|
|
|
|
<!-- Archive Content -->
|
|
|
|
<section class="container my-5">
|
|
|
|
<h1 class="display-4 text-center">Letters to the Editor</h1>
|
2024-06-20 19:02:27 +00:00
|
|
|
<div class="list-group">
|
2024-06-20 18:53:04 +00:00
|
|
|
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
|
2024-06-20 19:02:27 +00:00
|
|
|
<a href="<?php the_permalink(); ?>" class="list-group-item list-group-item-action">
|
|
|
|
<h5 class="mb-1"><?php the_title(); ?></h5>
|
|
|
|
<p class="mb-1">
|
|
|
|
<?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();
|
|
|
|
}
|
|
|
|
?> | <?php the_date(); ?>
|
|
|
|
</p>
|
|
|
|
<p class="mb-1"><?php the_excerpt(); ?></p>
|
|
|
|
</a>
|
2024-06-20 18:53:04 +00:00
|
|
|
<?php endwhile;
|
|
|
|
else : ?>
|
|
|
|
<p><?php _e('Sorry, no letters found.', 'duck-behavior-journal'); ?></p>
|
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
2024-06-20 19:02:27 +00:00
|
|
|
<div class="row mt-4">
|
2024-08-03 10:59:01 +00:00
|
|
|
<div class="pagination col-md-12">
|
2024-06-20 18:53:04 +00:00
|
|
|
<?php
|
2024-08-03 10:59:01 +00:00
|
|
|
global $wp_query;
|
|
|
|
|
2024-06-20 18:53:04 +00:00
|
|
|
echo paginate_links(array(
|
|
|
|
'total' => $wp_query->max_num_pages,
|
2024-08-03 10:59:01 +00:00
|
|
|
'current' => max(1, get_query_var('paged')),
|
|
|
|
'format' => '?paged=%#%',
|
|
|
|
'show_all' => false,
|
|
|
|
'end_size' => 2,
|
|
|
|
'mid_size' => 1,
|
|
|
|
'prev_next' => true,
|
|
|
|
'prev_text' => __('« Prev', 'duck-behavior-journal'),
|
|
|
|
'next_text' => __('Next »', 'duck-behavior-journal'),
|
|
|
|
'type' => 'plain'
|
2024-06-20 18:53:04 +00:00
|
|
|
));
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<?php get_footer(); ?>
|