100, 'orderby' => 'title', 'order' => 'ASC']); } // Default books from authorbdmurphy.com (used when BD Bookshelf plugin is not active) $uploads = wp_upload_dir(); $cover_dir = $uploads['baseurl'] . '/book-covers'; $default_books = array( array( 'title' => 'Pandemic Hacker', 'cover' => $cover_dir . '/pandemic-hacker.jpg', 'author' => 'B.D. Murphy', 'rating' => '4.4', 'url' => 'https://books2read.com/u/ml8z0W', ), array( 'title' => 'Pandemic Hacker 2', 'cover' => $cover_dir . '/pandemic-hacker-2.jpg', 'author' => 'B.D. Murphy', 'rating' => '4.9', 'url' => 'https://books2read.com/u/4jjzvD', ), array( 'title' => 'The Last Dwarf', 'cover' => $cover_dir . '/the-last-dwarf.jpg', 'author' => 'B.D. Murphy', 'rating' => '3.6', 'url' => 'https://books2read.com/u/bPAD27', ), array( 'title' => 'Deal Hunter', 'cover' => $cover_dir . '/deal-hunter.jpg', 'author' => 'B.D. Murphy', 'rating' => '5.0', 'url' => 'https://books2read.com/u/3LxrVN', ), array( 'title' => 'Nanite Evolution', 'cover' => $cover_dir . '/nanite-evolution.jpg', 'author' => 'B.D. Murphy', 'rating' => '5.0', 'url' => 'https://books2read.com/u/4E08e0', ), array( 'title' => 'Sidney and Watson: Time Detectives', 'cover' => $cover_dir . '/sidney-watson.jpg', 'author' => 'B.D. Murphy', 'rating' => '5.0', 'url' => 'https://books2read.com/u/3kXXEW', ), ); ?>
title); $cover_url = esc_url($book->cover_image); $book_url = home_url('/book/' . urlencode($book->slug) . '/'); $author_name = ''; // Get primary author name if (!empty($book->authors)) { foreach ($book->authors as $ba) { if ($ba->is_primary) { $author_name = esc_html($ba->author_name); break; } } if (empty($author_name) && isset($book->authors[0])) { $author_name = esc_html($book->authors[0]->author_name); } } if (empty($author_name)) { $author_name = 'B.D. Murphy'; } // Rating display $rating_display = ''; if ($book->rating_amazon > 0 || $book->rating_goodreads > 0) { $parts = []; if ($book->rating_amazon > 0) { $parts[] = 'Amazon: ' . number_format($book->rating_amazon, 1); } if ($book->rating_goodreads > 0) { $parts[] = 'Goodreads: ' . number_format($book->rating_goodreads, 1); } $rating_display = implode(' | ', $parts); } // Series info $series_info = ''; if ($book->series_id > 0 && class_exists('BDM_Series')) { $series = BDM_Series::get_series($book->series_id); if ($series) { $series_info = $series->name; } } // Description (truncated) $description = ''; if (!empty($book->description)) { $description = wp_trim_words(wp_strip_all_tags($book->description), 30); } ?>
<?php echo esc_attr($book['title']); ?>

/5