<?php
/**
 * Used for the testimonial archives
 * @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 clearfix">
        <h1><?php post_type_archive_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="testimonials-archive-wrap" class="boxed container clearfix">
	<?php
    // Add post div is sidebar is enabled for these archives
    if( of_get_option('testimonials_archive_sidebar','' ) == '1' ) {
        echo '<div id="post">';
    }
		// Begin Loop
		if( have_posts() ) : ?>
            <div class="testimonials-wrap clearfix">
				<?php
                while (have_posts()) : the_post();
                    get_template_part( 'content', 'testimonials' ); // Get testimonials entry layout
                endwhile; ?> 
            </div><!-- #testimonials-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('testimonials_archive_sidebar','' ) == '1' ) {
        echo '</div>';
        get_sidebar();
    } ?>
</div><!-- #testimonials-archive-wrap -->

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