2024-06-20 08:52:49 +00:00
|
|
|
<?php get_header(); ?>
|
|
|
|
|
|
|
|
<!-- Archive Content -->
|
|
|
|
<section class="container my-5">
|
|
|
|
<h1 class="display-4 text-center">Articles</h1>
|
2024-06-20 09:33:49 +00:00
|
|
|
<div class="row mb-4">
|
|
|
|
<div class="col-md-12">
|
|
|
|
<form method="GET" action="">
|
|
|
|
<select name="publication_status" onchange="this.form.submit()">
|
|
|
|
<option value=""><?php _e('All Statuses', 'duck-behavior-journal'); ?></option>
|
|
|
|
<?php
|
|
|
|
$terms = get_terms(array(
|
|
|
|
'taxonomy' => 'publication_status',
|
|
|
|
'hide_empty' => false,
|
|
|
|
));
|
|
|
|
foreach ($terms as $term) {
|
|
|
|
$selected = (isset($_GET['publication_status']) && $_GET['publication_status'] == $term->slug) ? 'selected' : '';
|
|
|
|
echo '<option value="' . esc_attr($term->slug) . '" ' . $selected . '>' . esc_html($term->name) . '</option>';
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-06-20 08:52:49 +00:00
|
|
|
<div class="row">
|
|
|
|
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
|
|
|
|
<div class="col-md-4">
|
|
|
|
<div class="card mb-4 shadow-sm">
|
|
|
|
<?php if (has_post_thumbnail()) : ?>
|
|
|
|
<img src="<?php the_post_thumbnail_url(); ?>" class="card-img-top" alt="<?php the_title(); ?>">
|
|
|
|
<?php endif; ?>
|
|
|
|
<div class="card-body">
|
|
|
|
<h5 class="card-title"><?php the_title(); ?></h5>
|
|
|
|
<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 08:52:49 +00:00
|
|
|
<a href="<?php the_permalink(); ?>" class="btn btn-outline-primary">Read More</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php endwhile;
|
|
|
|
else : ?>
|
|
|
|
<p><?php _e('Sorry, no articles found.', 'duck-behavior-journal'); ?></p>
|
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
2024-06-20 09:37:41 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12">
|
|
|
|
<?php
|
|
|
|
echo paginate_links(array(
|
|
|
|
'total' => $loop->max_num_pages,
|
|
|
|
));
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-06-20 08:52:49 +00:00
|
|
|
</section>
|
|
|
|
|
|
|
|
<?php get_footer(); ?>
|