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

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