Continues the Bookshelf history. The three plugins tracked there are consolidated into umbra-bookshelf/ and this repository becomes the canonical home for the plugin and the theme. bd-bookshelf/ -> theme/ separate artifact, name unchanged (root specs) -> umbra-bookshelf/spec/ aligned to Umbra Bookshelf old plugin zips -> archive/pre-umbra-releases/ Adds a repository README and drops the Bookshelf closure notice.
92 lines
3.7 KiB
PHP
92 lines
3.7 KiB
PHP
<?php
|
|
// Copyright 2026 Umbra Tools (umbratools.com)
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
/**
|
|
* Template Name: Reviews
|
|
*
|
|
* @package BD_Murphy
|
|
*/
|
|
|
|
get_header();
|
|
?>
|
|
|
|
<div class="page-container with-sidebar">
|
|
<div class="page-content">
|
|
<div class="reviews-container">
|
|
<header class="page-header">
|
|
<h1 class="page-title"><?php esc_html_e('Reviews', 'bd-bookshelf'); ?></h1>
|
|
</header>
|
|
|
|
<div class="reviews-grid">
|
|
<?php
|
|
if (have_posts()) :
|
|
while (have_posts()) :
|
|
the_post();
|
|
$book_id = get_the_ID();
|
|
$title = esc_html(get_the_title());
|
|
|
|
$reviews = array();
|
|
if (class_exists('BD_BookShelfHelper')) {
|
|
$reviews = BD_BookShelfHelper::get_reviews($book_id);
|
|
}
|
|
$review_count = count($reviews);
|
|
?>
|
|
<article class="review-card">
|
|
<div class="review-card-cover">
|
|
<a href="<?php the_permalink(); ?>">
|
|
<?php if (has_post_thumbnail()) : ?>
|
|
<?php the_post_thumbnail('rev-thumb'); ?>
|
|
<?php endif; ?>
|
|
</a>
|
|
</div>
|
|
<div class="review-card-info">
|
|
<h2 class="review-card-title">
|
|
<a href="<?php the_permalink(); ?>"><?php echo $title; ?></a>
|
|
</h2>
|
|
<p class="review-count">
|
|
<?php
|
|
printf(
|
|
esc_html(_n('%d review', '%d reviews', $review_count, 'bd-bookshelf')),
|
|
$review_count
|
|
);
|
|
?>
|
|
</p>
|
|
|
|
<?php if ($reviews) : ?>
|
|
<?php $display_reviews = array_slice($reviews, 0, 3); ?>
|
|
<?php foreach ($display_reviews as $review) : ?>
|
|
<div class="review-entry">
|
|
<span class="review-source"><?php echo esc_html(strtoupper($review->source_name)); ?></span>
|
|
<p class="review-synopsis"><?php echo esc_html($review->synopsis ?: wp_trim_words($review->comment_text, 15)); ?></p>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
|
|
<a href="<?php the_permalink(); ?>" class="view-all-reviews">
|
|
<?php esc_html_e('View all reviews', 'bd-bookshelf'); ?>
|
|
</a>
|
|
</div>
|
|
</article>
|
|
<?php
|
|
endwhile;
|
|
else :
|
|
?>
|
|
<p class="no-reviews"><?php esc_html_e('No reviews available yet.', 'bd-bookshelf'); ?></p>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<aside class="page-sidebar">
|
|
<?php if (is_active_sidebar('home-sidebar')) : ?>
|
|
<div class="home-sidebar">
|
|
<?php dynamic_sidebar('home-sidebar'); ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
</aside>
|
|
</div>
|
|
|
|
<?php
|
|
get_footer();
|