<?php
/**
 * Used for the portfolio tags
 * @package Ultra WordPress Theme
 * @since 1.0
 * @author AJ Clarke : http://wpexplorer.com
 * @copyright Copyright (c) 2012, AJ Clarke
 * @link http://wpexplorer.com
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 */

get_header(); // Loads the header.php template ?>

<header id="page-heading">
    <div class="boxed">
        <h1><?php echo single_term_title(); ?></h1>
        <?php
		// Yoast breadcrumbs support
		if( function_exists('yoast_breadcrumb') ) yoast_breadcrumb('<div id="breadcrumbs"><span class="icon-home"></span>','</div>'); ?>
	</div><!-- .boxed -->
</header><!-- #page-heading -->

<div id="portfolio-tag-wrap" class="boxed container clearfix">
	<?php
    // Add post div is sidebar is enabled for these archives
    if( of_get_option('portfolio_archive_sidebar','' ) == '1' ) {
        echo '<div id="post">';
    }
		// Begin Loop
		if( have_posts() ) :
			// Load scripts for masonry style portfolio
			if( of_get_option('portfolio_archive_style' ) == 'masonry' ) {
				wp_enqueue_script('isotope');
				wp_enqueue_script('wpex-isotope-portfolio');
			} ?>
            <div class="portfolio-wrap clearfix">
				<?php
                $wpex_portfolio_count=0;
                while (have_posts()) : the_post();
                    $wpex_portfolio_count++;
                    get_template_part( 'content', 'portfolio' ); // Get portfolio entry layout
                endwhile; ?> 
            </div><!-- #portfolio-wrap -->
            <?php wpex_pagination(); // Paginate your posts
			else :
			_e('There are no posts to show for this archive','wpex');
		endif; // End Loop
	
	// close post div is sidebar is enabled for these archives & get sidebar
    if( of_get_option('portfolio_archive_sidebar','' ) == '1' ) {
        echo '</div>';
        get_sidebar();
    } ?>
</div><!-- #portfolio-archive-wrap -->

<?php get_footer(); //get template footer ?>