<?php get_header(); ?>
<div class="page-title">
	<div class="container center-align">
		<h1>Frequently Asked Questions</h1>

		<p class="lead-para">
			Looking for more information? Our FAQs should be able to help.
		</p>
	</div> 
</div>


<?php 
//get taxonomies available from post type
$taxonomy_objects = get_object_taxonomies( get_post_type(), 'objects' );
$taxonomies = array();
//get all possible taxonomies, loop through into array
foreach($taxonomy_objects as $taxonomy_object) {
	array_push($taxonomies, $taxonomy_object); 
} 
?>

<section class=" page-section faq-content-links">
	<div class="container">
		<div class="row">

					
					<?php 
					// foreach taxonomy, display a filter tool
					foreach ($taxonomies as $taxonomy): 			
						//get all terms 
						$terms = get_terms( $taxonomy->name, array(
							'hide_empty' => false,
						) );
						$activestate = " "; ?>

						<?php if ($terms): ?>

							<ul class="faq-term-links nospace-mobile">

								<?php foreach($terms as $term) {
									// ensure filter is set to current active term

									if ($term->name != 'Uncategorized') {
										echo '<li><a href="' . get_term_link($term) .'"><span>' . $term->name . "</span></a></li>";
									}
								} 
								?>
							</ul>

						<?php endif; ?>
					<?php endforeach; ?>
				</div>


		</div> 
	</div>
</section>



<?php get_footer(); ?>
