add unanswered questions to the list too

This commit is contained in:
Evan Mullins 2020-02-10 10:57:53 +01:00
parent eafffdf3bd
commit 0c7fc0a891

View file

@ -26,12 +26,12 @@ get_header();
?>
<?php
// Questions
/* Start the Loop */
// Answered Questions
$terms = get_terms([
'taxonomy' => 'question',
'hide_empty' => true,
'taxonomy' => 'question',
'hide_empty' => false,
'count' => true,
'orderby' => 'count',
]);
?>
@ -45,12 +45,18 @@ get_header();
$termid = $term->term_id;
// if has answers
if ( 0 < $termid->count ) {
?>
<li><a class="question question-<?php echo $termid; ?>"
href="<?php echo get_term_link( $termid ); ?>">
<?php echo $term->name; ?>
</a></li>
<?php
} else {
?>
<li><?php echo $term->name; ?></li>
<?php
}
}
?>
</ul>