the-process

Custom Book Reviews Archive Page

I wanted an archive page for my book reviews that showed, for each book, its front cover and an excerpt of the review. <?php /** * Template Name: Book Reviews Template * Description: Used as a page template to show page contents, followed by a loop * through the Book Review (book-review) Category */ add_action('genesis_loop', 'zoia_book_reviews_loop'); function zoia_book_reviews_loop() { $args = array( 'category_name' => 'book-review', // category slug 'order_by' => 'post_date', 'order' => 'DESC', 'posts_per_page' => '10', ); $loop = new WP_Query($args); if($loop->have_posts()) { while ($loop->have_posts() ): $loop->the_post(); echo '<div class="book-review-line">'; echo '<div class="one-sixth first book-review-bookcover">'; if(has_post_thumbnail()) { echo '<a href="' . Read more...