<?php global $asteria;?>&#13;
<div class="lay4">&#13;
<div class="center">&#13;
&#13;
<div class="lay4_wrap&lt;?php if ( !is_active_sidebar( 'sidebar' ) ) { ?&gt; no_sidebar&lt;?php } ?&gt;">&#13;
<div class="lay4_inner">&#13;
<?php if ( is_home() ) { ?>&#13;
    <div class="lay1_title">&#13;
	<?php echo $asteria['posts_title_id']; ?>&#13;
    </div>&#13;
<?php }?>&#13;
                   <?php if(have_posts()): ?><?php while(have_posts()): ?><?php the_post(); ?>&#13;
                <div post_class> id="post-<?php the_ID(); ?>"&gt; &#13;
&#13;
                <div class="post_image">&#13;
                     <!--CALL TO POST IMAGE-->&#13;
                    <?php if ( has_post_thumbnail() ) : ?>&#13;
                    <div class="imgwrap">&#13;
                    <a href="&lt;?php%20the_permalink();?&gt;"><?php the_post_thumbnail('medium'); ?></a></div>&#13;
                    &#13;
                    <?php elseif($photo = asteria_get_images('numberposts=1', true)): ?>&#13;
    &#13;
                    <div class="imgwrap">&#13;
                	<a href="&lt;?php%20the_permalink();?&gt;"><?php echo wp_get_attachment_image($photo[0]->ID ,'medium'); ?&gt;</a></div>&#13;
                &#13;
                    <?php else : ?>&#13;
                    &#13;
                    <div class="imgwrap">&#13;
                    <a href="&lt;?php%20the_permalink();?&gt;"><img src="&lt;?php%20echo%20get_template_directory_uri();%20?&gt;/images/blank_img.png" alt="&lt;?php the_title_attribute(); ?&gt;" class="asteria_thumbnail"></a></div>   &#13;
                             &#13;
                    <?php endif; ?>&#13;
                </div>&#13;
                &#13;
                <div class="post_content">&#13;
                    <h2 class="postitle"><a href="&lt;?php%20the_permalink();?&gt;" title="&lt;?php the_title_attribute(); ?&gt;"><?php the_title(); ?></a></h2>&#13;
                    <div class="single_metainfo">&#13;
                    <i class="fa-calendar"></i><a class="comm_date"><?php the_time( get_option('date_format') ); ?></a>&#13;
                    <i class="fa-user"></i><?php global $authordata; $post_author = "<a class='auth_meta' href=\"".get_author_posts_url( $authordata->ID, $authordata-&gt;user_nicename )."\"&gt;".get_the_author()."\r\n"; echo $post_author; ?&gt;&#13;
                    <i class="fa-comments"></i><?php if (!empty($post->post_password)) { ?&gt;&#13;
                <?php } else { ?><div class="meta_comm"><?php comments_popup_link( __('0 Comment', 'asteria'), __('1 Comment', 'asteria'), __('% Comments', 'asteria'), '', __('Off' , 'asteria')); ?></div><?php } ?>&#13;
                &#13;
                  <i class="fa-th-list"></i><div class="catag_list"><?php the_category(', '); ?></div>&#13;
                    </div>&#13;
                    <?php the_excerpt(); ?> &#13;
                    &#13;
                </div>&#13;
                &#13;
                        </div>&#13;
            <?php endwhile ?> &#13;
&#13;
            <?php endif ?>&#13;
</div>&#13;
<!--PAGINATION START-->&#13;
<div class="ast_pagenav">&#13;
	<?php global $wp_query;
        $big = 999999999; // need an unlikely integer
            echo paginate_links( array(
                'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),&#13;
                'format' =&gt; '?paged=%#%',&#13;
                'current' =&gt; max( 1, get_query_var('paged') ),&#13;
                'total' =&gt; $wp_query-&gt;max_num_pages,&#13;
                'show_all'     =&gt; true,&#13;
                'prev_next'    =&gt; false&#13;
            &#13;
            ) );&#13;
    ?&gt;&#13;
</div>&#13;
<!--PAGINATION END-->&#13;
&#13;
<?php wp_reset_query(); ?>&#13;
</div>&#13;
&#13;
&#13;
            &#13;
    <?php if ( is_active_sidebar( 'sidebar' ) ) { ?><?php get_sidebar();?><?php } ?>&#13;
    </div>&#13;
	</div>&#13;
