Skip to content

Instantly share code, notes, and snippets.

@bradonomics
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradonomics/c2e1d8f006e9e60d0e18 to your computer and use it in GitHub Desktop.
Save bradonomics/c2e1d8f006e9e60d0e18 to your computer and use it in GitHub Desktop.
Custom Post Template for Book Reviews. Uses Advanced Custom Fields plugin: https://wordpress.org/plugins/advanced-custom-fields/ and Single Post Template plugin: https://wordpress.org/plugins/single-post-template/
<?php
/*
* Single Post Template: Book Review
*
*/
//* Add Aside for Buy the Book Info
add_action( 'genesis_entry_content', 'bw_book_review', 30 );
function bw_book_review() {
// Register the cover image as an object so the URL can be called.
$image = get_field('book_cover');
?>
<aside class="book-container book-content">
<div class="book-img">
<a href="<?php the_field( 'amazon_link' ); ?>"><img src="<?php echo $image['url']; ?>"></a>
</div>
<div class="book-info">
<p><span class="title"><?php the_field( 'book_title' ); ?></span><br>
<em>by <?php the_field( 'book_author' ); ?></em></p>
</div>
<div class="buy-info">
<p>Buy the book</p>
<a href="<?php the_field( 'amazon_link' ); ?>"><img src="images/amazon.jpg"></a>
</div>
</aside>
<?php
}
genesis();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment