<?php
/**
 * Template Name: FrontPage
 */

get_header(); ?>

	<div id="primary" class="content-area">
		<main id="main" class="site-main" role="main">
			<aside id="homepageMainMenu">
				<?php homepageGetMenuItems();?>
			</aside>
			<aside id="shareMenu">
				<?php wp_nav_menu(array(
					'menu'			=> 'Share menu',
					'container'		=> false
				)); ?>
			</aside>
			<div id="cubeWrapp">
				<div id="cube">
					<div id="cubeInner">
						<?php
						if ( have_posts() )
						{
							while ( have_posts() )
							{
								the_post();
								get_template_part( 'partials/front', 'page-first' );
							}
						}

						$queryArgs = array(
							'post_type'		=> 'page',
							'post_parent'	=> get_the_ID(),
							'order'			=> 'ASC'
						);

						$the_query = new WP_Query( $queryArgs );

						if ( $the_query->have_posts() )
						{
							while ( $the_query->have_posts() )
							{
								$the_query->the_post();
								get_template_part( 'partials/front', 'page' );
							}
						}
						wp_reset_postdata(); ?>
					</div>
				</div>
			</div>

		</main><!-- .site-main -->
	</div><!-- .content-area -->

<?php get_footer(); ?>