<?php get_header(); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div id="wrapper" class="fade-in-slow">
<header id="top">
<div class="nav-wrap">
<div class="prim">
<nav>
<ul class="menu">
<li><a href="<?php bloginfo('url'); ?>/#mybooks" alt="My books" class="books">My books</a></li>
<li><a href="<?php bloginfo('url'); ?>/#blog" alt="Blog" class="blog">Blog</a></li>
<li><a href="<?php bloginfo('url'); ?>/#askhoney" class="askhoney">Ask Honey</a></li>
<li><a href="<?php bloginfo('url'); ?>/#contact" class="contact">Contact</a></li>
</ul>
<ul id="logomark">
<li><a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>" class="home">Home</a></li>
</ul>
<ul id="right">
<li><a href="http://twitter.com/hesterbrowne" class="twitter">Twitter</a></li>
<li><a href="http://www.pinterest.com/hesterbrowne" class="pinterest">Pinterest</a></li>
<li><a href="http://www.facebook.com/HesterBrowneWriter" class="facebook">Facebook</a></li>
</ul>
</nav>
</div>
<div class="hatch"></div>
<div class="stamp"></div>
</div>
</header>
<div class="inner">
<article id="post-<?php the_ID(); ?>">
<section class="post-title"><h1><?php the_title(); ?></h1></section>
<section class="post">
<?php the_content(); ?>
<?php if ( in_category(4) ) { ?>
<hr/>
<?php the_field('review') ?>
<hr/>
<?php if(get_field('review')) { ?>
<div class="review">
<?php the_field('review') ?>
</div>
<?php } ?>
<div id="book-<?php the_ID(); ?>" class="bookcovers">
<?php
$rows = get_field('book_covers');
$row_count = count($rows);
$i = rand(0, $row_count - 1);?>
<img src="<?php echo $rows[$i]['image']; ?>" />
</div>
<?php if(get_field('synopsis')) { ?>
<hr/>
<p><strong>Synopsis</strong></p>
<?php the_field('synopsis') ?>
<?php } ?>
<?php } ?>
<?php if ( in_category(3) ) { ?>
<hr/>
<h1>Dear <?php the_field('questioners_name'); ?></h1>
<?php the_field('honeys_reply'); ?>
<?php } ?>
<footer>
<hr/>
<div class="a-options">
<a href="<?php comments_link(); ?>" class="comment-count"><?php comments_number('0', 'one', '%', 'hero'); ?></a>
<a href="<?php comments_link(); ?>" class="comments" title="Comments">Comments</a><span>/</span>
<a href="./feed/" class="subscribe" title="Subscribe and keep up to date with the goings on in Herefordshire">Subscribe</a><span>/</span>
<!-- share -->
<div class="share-button">
<div class="buttons">
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_pinterest_pinit"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-5005b98d5e449c9a"></script>
<!-- AddThis Button END -->
</div>
<span class="pseudo-button"><a href="#">+ Share</a></span>
</div> <!--! /share -->
</div><!--! /a-options -->
<hr/>
<?php $home = 2; ?>
<img src="<?php the_field('avatar', $home) ?>" />
<h4>About the author</h4>
<p><?php the_author_description(); ?></p>
</footer>
</section>
<?php comments_template(); ?>
<a href="#top" title="Top" class="top scrollto">
Top
</a>
</article>
<?php get_sidebar(); ?>
<footer class="whodidthis">
<a href="http://byassociationonly.com" title="By Association Only">By Association Only crafted this</a>
</footer>
</div>
</div>
<?php endwhile; endif; ?>
<?php get_footer(); ?>