<?php
/*
 Template Name: Home Page
 */ 
?>
<?php get_header(); ?>

			<div id="content" class ="homepage">

				<div id="inner-content" class="wrap cf">

						<main id="main" class="no-widgets-main m-all t-2of3 d-5of7 cf" role="main" itemscope itemprop="mainContentOfPage" itemtype="http://schema.org/Blog">

							<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

							<article id="post-<?php the_ID(); ?>" <?php post_class( 'cf home-article' ); ?> role="article" itemscope itemtype="http://schema.org/BlogPosting">
								<section class="entry-content cf" itemprop="articleBody">
									<div class="home-content">
									<?php
										// the content (pretty self explanatory huh)
										the_content();

										/*
										 * Link Pages is used in case you have posts that are set to break into
										 * multiple pages. You can remove this if you don't plan on doing that.
										 *
										 * Also, breaking content up into multiple pages is a horrible experience,
										 * so don't do it. While there are SOME edge cases where this is useful, it's
										 * mostly used for people to get more ad views. It's up to you but if you want
										 * to do it, you're wrong and I hate you. (Ok, I still love you but just not as much)
										 *
										 * http://gizmodo.com/5841121/google-wants-to-help-you-avoid-stupid-annoying-multiple-page-articles
										 *
										*/
										wp_link_pages( array(
											'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'bonestheme' ) . '</span>',
											'after'       => '</div>',
											'link_before' => '<span>',
											'link_after'  => '</span>',
										) );
									?>
									</div>
									<div class="ghost-image">
										<?php if ( has_post_thumbnail()): // check if the post has a Post Thumbnail assigned to it.
											echo get_the_post_thumbnail( get_the_ID(), "full", array ('class' => 'box-image')); 
									//wp_get_attachment_image_src( get_post_thumbnail_id(get_the_ID(), 'full') );; ?>
									<?php endif; ?>
									</div>
								</section> <?php // end article section ?>

								<footer class="article-footer cf">

								</footer>

								<?php comments_template(); ?>

							</article>

							<?php endwhile; endif; ?>
							
							<?php $args = array(
								'post_type'      => 'bottom_boxes',
								'posts_per_page' => -1,
								'order'          => 'ASC',
								'orderby'        => 'menu_order'
							 );


							$parent = new WP_Query( $args );?>

							<ul class="home-bottom-pages">
							<?php while ($parent->have_posts()) : $parent->the_post(); ?>

							<li>
							<span class="headline"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></span>
							<div class="box-content">
								<?php the_content(); ?>
							</div>
							<?php if ( has_post_thumbnail()): // check if the post has a Post Thumbnail assigned to it.
								echo get_the_post_thumbnail( get_the_ID(), "full", array ('class' => 'box-image')); 
								//wp_get_attachment_image_src( get_post_thumbnail_id(get_the_ID(), 'full') );; ?>
							<?php endif; ?>
							</li>
							  <?php endwhile; ?>
							</ul>

						</main>

				</div>

			</div>

<?php get_footer(); ?>
