<?php 

/*
* This template controlls the portfolio overview pages: 
* 4,3 2 and 1 Column Portfolios are generated by this file in conjunction with includes/loop-portfolio.php
*
* This file is called by the includes/helper_template.php file if the users applied a portfolio page to this page
* All logic checks are located in includes/helper_template.php function avia_get_template()
*/

global $avia_config;


	/*
	 * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.
	 */	
	 get_header();
	 
	 
 	 if(empty($avia_config['portfolio']['portfolio_columns'])) $avia_config['portfolio']['portfolio_columns'] = 4;
 	 echo avia_title();

	?>
		
		
		<div class='container_wrap main_color <?php avia_layout_class( 'main' ); ?>'>
			
			<div class='container container-portfolio-size-<?php echo $avia_config['portfolio']['portfolio_columns']; ?>'>
				
				<div class='content <?php avia_layout_class( 'content' ); ?> units template-portfolio-overview content portfolio-size-<?php echo $avia_config['portfolio']['portfolio_columns']; ?>'>
				
				<?php
				//display the default content of the portfolio
				if(isset($post->ID))
				{
					the_post();
					$slider = new avia_slideshow(get_the_ID());
					if($slider->slidecount) echo $slider->display();
					
					echo "<div class='post-entry post-entry-portfolio-first not-sortable'>";
					the_content();
					echo "</div>";

				}
				
				
				/* Run the loop to output the posts.
				* If you want to overload this in a child theme then include a file
				* called loop-portfolio.php and that will be used instead.
				*/
				
				get_template_part( 'includes/loop', 'portfolio' );
				
				?>
				
				
				<!--end content-->
				</div>
				
				<?php 
				
				wp_reset_query();
				
				//get the sidebar
				$avia_config['currently_viewing'] = 'portfolio';
				get_sidebar();
				
				?>
				
				
				
				
			</div><!--end container-->

	


<?php get_footer(); ?>