<!-- blog section --><?php $custom  = photofolio_custom();?>
<?php while(have_posts()) : the_post(); ?>
	<section class="blog-section standart single-post">
		<div class="container">
			<div class="blog-box">

				<div class="blog-post">
					<?php if(get_post_format()=='gallery'){ ?>
					 <?php 
					    $gallery = get_post_meta(get_the_ID(), '_photofolio_gallery', true);
					?>
					<?php if(count($gallery)>0 and $gallery!=''){ ?>
					<div class="post-gallery">
						<div class="flexslider">
							<ul class="slides">
								<?php foreach($gallery as $img) {?>
								<li><img src="<?php echo esc_attr($img); ?>" alt="<?php the_title(); ?>" class="img-responsive"/></li>
								<?php } ?>
							</ul>
						</div>
					</div>
					<?php } ?>

					<?php }elseif(get_post_format()=='video'){ ?>
						 <?php 
						    $video = get_post_meta(get_the_ID(), '_photofolio_intro_video', true);
						?><?php if($video!=''){ ?>
						<div class="post-gallery">
							<!-- Vimeo -->
							<?php echo wp_oembed_get(get_post_meta(get_the_ID(), '_photofolio_intro_video', true)); ?>
							<!-- End Vimeo -->
						</div>
						<?php } ?>
					<?php }elseif($custom['blog_thumbnail']!=false){ ?>
					<div class="post-gallery">
						<?php the_post_thumbnail(); ?>
					</div>
					<?php } ?>
					<div class="post-content">
						<?php $cats =get_the_category(); ?>
						<span><?php $i=1; foreach($cats as $cat){ if($i>1){echo ' ,';} echo esc_html($cat->name);  $i++;} ?></span>
						<h1><?php the_title(); ?></h1>
						<?php do_action('photofolio_post_meta');?>
						<?php the_content(); ?>
	                      <?php
	                        $defaults = array(
	                          'before'           => '<div id="page-links"><strong>Page: </strong>',
	                          'after'            => '</div>',
	                          'link_before'      => '<span>',
	                          'link_after'       => '</span>',
	                          'next_or_number'   => 'number',
	                          'separator'        => ' ',
	                          'nextpagelink'     => esc_html__( 'Next page','photofolio' ),
	                          'previouspagelink' => esc_html__( 'Previous page','photofolio' ),
	                          'pagelink'         => '%',
	                          'echo'             => 1
	                        );
	                       ?>
	                      <?php wp_link_pages($defaults); ?>
						<?php photofolio_post_share($id=get_the_ID()); ?>
					</div>
				</div>
				
				<?php if($custom['blog_author']==true){ ?>
					<div class="autor-post">
						<?php if(get_user_meta(get_the_author_meta('ID'), '_photofolio_avatar' ,true)!=''){ ?>
							<img src="<?php echo get_user_meta(get_the_author_meta('ID'), '_photofolio_avatar' ,true); ?>" />
							<?php }else{ ?>
							<?php 
							   echo get_avatar(get_the_author_meta('user_email'),$size='100',$default='http://0.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=120' );
							?>
							<?php } ?>
						<div class="autor-content">
							<h2><?php echo esc_html(get_the_author_meta('display_name'));?></h2>
							<p><?php echo esc_html(get_the_author_meta('description'));?> </p>
						</div>
					</div>
					<?php } ?>
					<?php if('open' == $post->comment_status){ ?>
					<?php comments_template(); ?>
					<?php } ?>
			</div>
		</div>
	</section>
	<!-- End blog section -->
<?php endwhile; ?>