@dotwebs: i have your same need and i create a template page called “allfaq” with this code inside (based on twentysixteen theme)
<?php
/*
Template Name: allfaq
pagina per mostrare i risultati di ricerca
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry-content">
<?php
//retrieve all cat name
$taxonomy = 'faq_cat';
$term_args=array(
'hide_empty' => false,
'orderby' => 'name',
'order' => 'ASC'
);
$tax_terms = get_terms( $taxonomy, $term_args );
foreach ( $tax_terms as $tax_term ) {
echo "<a href=".$tax_term->slug.">".$tax_term->name."</a> -";
$count = 0;
$accordion = 'accordion-' . time() . rand();
$args=array(
'post_type' => 'faq',
'taxonomy' => 'faq_cat',
'term' => $tax_term->name,
'order' => 'DESC',
'orderby' => 'date',
'showposts' => '-1'
);
$the_query = new WP_Query($args);
while ( $the_query->have_posts() ) :
$the_query->the_post();
?>
<div class="accordion" id="<?php echo $accordion . $count;?>">
<h3><?php the_title();?></h3>
<div>
<?php the_content();?>
</div>
<?php //end while
?>
</div>
<?php endwhile; ?>
<?php
}
?>
</div>
</article><!-- #post-## -->
</main><!-- .site-main -->
</div><!-- .content-area -->
<?php
// Ripristina Query & Post Data originali
wp_reset_query();
wp_reset_postdata();
?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
now i have
in one page all cat with his faq
ie.:
cat1
– faq1
– faq2
– faq5
cat2
– faq4
– faq3
– faq6
cat3
– faq7
– faq11
– faq9
etc….
try it and let me know…