<?php get_header(); ?>
    <!-- Single -->
	<?php 
	    // Single 
	    if (have_posts()):
		while (have_posts()): the_post(); 
		?>
		
		<div class="press_page">
	    	<div class="bread_in">
	            <?php // Top before content
		        	the_title( '<h1 class="press_heading">', '</h1>' ); 
		        	dimox_breadcrumbs(); 
	        	?>
        	</div>
    	</div>
		
		<section class="press_singlepost">
	        <div class="press_container">
			
			    <div class="press_singlecontent clear">
				
				    <div class="press_primary">
					    <div class="primary_content">
						
							<?php if (has_post_thumbnail()) {
					            echo '<div class="content_thumbnail">'.get_the_post_thumbnail($post->ID, 'full',
    				                array(
				    	                'alt' => trim(strip_tags($post->post_title)),
				    	                'title' => trim(strip_tags($post->post_title)),
			    	                )).'</div>'; 
							} ?>
							
							<div class="press_article">
							    <?php the_content(); ?>
							</div>
							
						</div>
					</div>
					
					<div class="press_secondary">
					
						<div class="secondary_content">
						    
							<div class="blog_auth">
							    <?php 
								    if ( get_the_author_meta( 'user_meta_image' ) != "" ) {
							            echo '<img src="'. esc_url( get_the_author_meta( 'user_meta_image' ) ).'" alt="penulis" />';
								    } 
								?>
							</div>
							
							<div class="auth_name"><?php the_author(); ?></div>
							
						    <div class="clear content_meta">
								<span class="meta_icon"><i class="fa fa-clock-o"></i> <?php echo __( 'Publish', 'prestasi' ); ?></span><span class="meta_date"><?php echo the_date(); ?></span>
                            </div>
							
							<div class="clear content_meta">
								<span class="meta_icon"><i class="fa fa-heart-o"></i> <?php echo __( 'Dibaca', 'prestasi' ); ?> <?php setPostViews(get_the_ID()); ?><?php echo getPostViews(get_the_ID()).' Kali'; ?></span>
                            </div>
							
							<?php if (comments_open()): ?>
								<div class="clear content_meta">
								    <span class="meta_icon">
									    <i class="fa fa-commenting-o"></i> <a href="#comments"><?php comments_number(__('Belum Ada Komentar', 'prestasi'), __('Pos Ini Memiliki 1 Komentar', 'prestasi'), __('Pos Ini Memiliki % Komentar', 'prestasi'), '', __('', 'prestasi') ); ?></a>
									</span>
				    	        </div>
							<?php endif; ?>
							
							<div class="press_cat clear">
								<?php 
					                    $terms = get_the_terms( $post->ID , 'blog-kat' );
										if ( $terms != null ){
											foreach( $terms as $term ) {
												$term_link = get_term_link( $term, 'blog-kat');
												echo '<a href="' . $term_link . '">' . $term->name . '</a> ';
												unset($term); 
											} 
										} 
								?>
							</div>
							
							<?php 
								post_another_blogs();
								
								if (comments_open()): 
								?>
									<div class="prestasi__post">
									    <h4 class="press_heads">
										    <?php echo comments_number(__('0 Komentar', 'prestasi'), __('1 Komentar', 'prestasi'), __('% Komentar', 'prestasi'), '', __('', 'prestasi') ); ?>
									    </h4>
										<?php echo comments_template(); ?>
									</div>
								<?php
								endif;
							?>
							
						</div>
						
			        </div>
					
				</div>
				
			</div>
		</section>
		
		<?php 
		endwhile; 
	    endif; 
	?>
	
<?php get_footer(); ?>