<?php /**
 * Template Name: Blog Page
 *  */?>
<?php get_header(); ?>
<div id="wrapper" class="container_12">
<?php
if (is_page() ) {
  $args=array(    'paged' => (get_query_var('paged')) ? get_query_var('paged') : 1 );
  $temp = $wp_query;   
  $wp_query = null;
  $wp_query = new WP_Query($args); ?>
<div class="grid_8">  
<?php  if( have_posts() ) : 	while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
  
<div <?php post_class() ?> > 
<h2 class="title">
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permanent Link to %s', 'mt-dark' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<div class="entry">
<?php if ( (function_exists( 'add_theme_support' ))  && ( has_post_thumbnail() )){
the_post_thumbnail('single_post'); } ?>
<?php the_content(__('(more...)','mt-dark')); ?>
<div class="clear"></div>
</div>
<div class="postmeta">  
<ul>
<?php wp_link_pages( array( 'before' => '<li class="page-link">' . __( 'Pages:','mt-dark' ), 'after' => '<br /></li>' ) ); ?>
<li><?php comments_popup_link( __( 'Leave a comment', 'mt-dark' ), __( '1 Comment', 'mt-dark' ), __( '% Comments', 'mt-dark' ) ); ?>, </li>
<li><?php _e('Author','mt-dark'); ?>: <?php the_author_posts_link(); ?>, </li>
<li><?php dark_posted_on(); ?>, <?php edit_post_link(__('Edit This','mt-dark')); ?><br /></li>
<li><?php _e('Categories','mt-dark'); ?>: <?php the_category(' , ') ?><br /></li>
<li><?php if (the_tags()) : ?><?php the_tags(' ' ,  ' ,  ' ,  ' ') ?><?php endif; ?>&nbsp;</li>
</ul>	
</div>
</div>
<?php comments_template( '', true ); ?>
<?php endwhile;   ?>
<?php  if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else {  dark_pagination();  } ?>
<?php   else : ?>
<div class="title">   
<h1><?php _e('Not Found','mt-dark'); ?></h1>
<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'mt-dark' ); ?></p>
</div>
<?php endif; $wp_query = $temp; } ?>


</div> 
 
<?php get_sidebar(); ?>
<div class="clear"></div>
</div> 
<?php get_footer(); ?>
        

