<?php get_header('clean'); ?>


<div class="conteudosingle">

<nav id="menumain1" class="menuimg"><?php wp_nav_menu( array('theme_location' => 'menupage', 'container_id' => 'coffeetime-menu-page', 'fallback_cb' => 'wp_page_menu', )); ?></nav>

			<?php while ( have_posts() ) : the_post(); ?>

				<div class="nav-gal">
					<?php previous_image_link( array( 64, 64 ) ); ?>
					<?php next_image_link( array( 64, 64 ) ); ?>
				</div>

				<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
						<h3 class="entry-title"><?php the_title(); ?></h3>


					<div class="entry-content">

						<div class="entry-attachment">
							<div class="attachment">
								<?php
									$attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) );
									foreach ( $attachments as $k => $attachment ) {
										if ( $attachment->ID == $post->ID )
											break;
									}
									$k++;
									if ( count( $attachments ) > 1 ) {
										if ( isset( $attachments[ $k ] ) )
											$next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
										else
											$next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID );
									} else {
										$next_attachment_url = wp_get_attachment_url();
									}
								?>
								<div class="imggal">
								<a href="<?php echo $next_attachment_url; ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php
									$attachment_size = apply_filters( 'coffeetime_attachment_size', array( 1200, 1200 ) ); 
									echo wp_get_attachment_image( $post->ID, $attachment_size );
								?></a>
								</div>
							</div>

							<?php if ( ! empty( $post->post_excerpt ) ) : ?>
							<div class="entry-caption">
								<?php the_excerpt(); ?>
							</div>
							<?php endif; ?>
						</div>

						<?php the_content(); ?>
						<?php wp_link_pages(); ?>

					</div>


				
					<div class="entry-meta">
					<p><small>
						<?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>
									<?php echo comments_number(); ?> &bull; 
						<?php endif; ?>
						<?php
							$metadata = wp_get_attachment_metadata();
							printf( __( '<time class="entry-date" datetime="%1$s" pubdate>%2$s</time> &bull; <a href="%3$s" title="Link to full-size image">%4$s &times; %5$s</a> &bull; <a href="%6$s" title="Return to %7$s" rel="gallery">%7$s</a>', 'coffeetime' ),
								esc_attr( get_the_date( 'c' ) ),
								esc_html( get_the_date() ),
								wp_get_attachment_url(),
								$metadata['width'],
								$metadata['height'],
								get_permalink( $post->post_parent ),
								get_the_title( $post->post_parent )
							);
						?> &bull; <?php the_author_posts_link(); ?> <?php edit_post_link(); ?></small></p>
						
					</div>
					
				<?php comments_template(); ?>
</div>
			<?php endwhile; ?>


</div>


<?php get_footer('clean'); ?>