50 lines
1.7 KiB
PHP
50 lines
1.7 KiB
PHP
<?php
|
|
// Copyright 2026 Umbra Tools (umbratools.com)
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
/**
|
|
* Template Name: Series Listing
|
|
*/
|
|
|
|
get_header();
|
|
?>
|
|
|
|
<div class="series-container">
|
|
<header class="page-header">
|
|
<h1 class="page-title"><?php esc_html_e('Series', 'bd-murphy'); ?></h1>
|
|
</header>
|
|
|
|
<div class="series-list">
|
|
<?php
|
|
if (have_posts()) :
|
|
while (have_posts()) :
|
|
the_post();
|
|
$series_id = get_the_ID();
|
|
$cover_url = BD_BookShelfHelper::get_series_cover_url($series_id, 'series-card');
|
|
$name = get_the_title();
|
|
$slug = get_post_field('post_name');
|
|
$blurb = BD_BookShelfHelper::get_series_blurb($series_id);
|
|
$book_count = BD_BookShelfHelper::get_series_book_count($series_id);
|
|
?>
|
|
<article class="series-card">
|
|
<a href="<?php the_permalink(); ?>">
|
|
<img src="<?php echo esc_url($cover_url); ?>" alt="<?php echo esc_attr($name); ?>" class="series-cover">
|
|
</a>
|
|
<h2 class="series-name">
|
|
<a href="<?php the_permalink(); ?>"><?php echo esc_html($name); ?></a>
|
|
</h2>
|
|
<p class="series-blurb"><?php echo esc_html($blurb); ?></p>
|
|
<p class="series-book-count"><?php printf(esc_html(_n('%d book', '%d books', $book_count, 'bd-murphy')), $book_count); ?></p>
|
|
</article>
|
|
<?php
|
|
endwhile;
|
|
else :
|
|
?>
|
|
<p class="no-series"><?php esc_html_e('No series available yet.', 'bd-murphy'); ?></p>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
|
|
<?php
|
|
get_footer();
|