<?php
/*
 Template Name: Pinterst Style
*/
?>
<?php get_header();?>

<div id="main">
  <div class="fullContainer">
                	<div id="pin-content">
					<?php 
					$temp = $wp_query; $wp_query= null;
					$wp_query = new WP_Query(); $wp_query->query('showposts=20' . '&paged='.$paged);
					while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
                    <article class="pin-box entry">
                    <div class="img-item"><?php $img = catch_that_image($post->ID); ?>
                    <a href="<?php echo $img ?>" class="prettyPhoto" rel="prettyPhoto">
                    
                    <img src="<?php echo $img ?>" alt="<?php the_title(); ?>"><span class="zoomex">&nbsp;</span></a>
                    </div>
                    <div class="pin-ecxt">
                    <h4><a href="<?php the_permalink();?>"><?php the_title(); ?></a></h4>
                    <h6 class="blog-author"><?php the_time('F d, Y'); ?></h6>
                    <p><?php echo excerpt(10); ?></p>
                    </div>
                    <div class="pin-ecxt2">
                    <?php echo get_avatar( get_the_author_meta( 'user_email' ), '92' ); ?>
                    <p>
                    <small>Posted by</small>
                    <?php the_author(); ?>
                    </p>
                    </div>
                    
                    </article>
                    
                    <?php endwhile; ?>
					<?php if ($paged > 1) { ?>
                     
                    <?php } else { ?>
                    <?php } ?>
                   
                    <?php wp_reset_postdata(); ?>
                      
                    
                    </div><!--End Pin-->
                     <div class="mainPagination container">
                        <div class="pagesNambers"><?php lio_pagination(); ?></div><!--En Nambers-->
                        <?php
                         if( get_next_posts_link() || get_previous_posts_link() ) { ?>
                            <div class="paginationLinks">
                                <?php previous_posts_link('<i class="icon-angle-left"></i>'); ?>
                                <?php next_posts_link('<i class="icon-angle-right"></i>'); ?>
                            </div>	
                        <?php } ?>
                    </div><!--End MainBagination-->
                    </div><!--End FullContainer-->
  
<script>
	jQuery(window).load(function() {

	// Initialize Masonry
	if(jQuery('#pin-content').length){
		jQuery('#pin-content').masonry({
			itemSelector: '.pin-box',
		}).imagesLoaded(function() {
			jQuery('#pin-content').data('masonry');
		});
	}

});

	
</script>
</div>
<!--End Main-->
</div>
<!--End Content-->
<?php get_footer();?>
