Skip to content

Commit 5cd612e

Browse files
correct double render of questions within nested groups
1 parent 1bc1957 commit 5cd612e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/page_faqs.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@
135135
<li>
136136
<a href="#<?php echo (str_replace(' ', '-', strtolower($question->post_title))); ?>"><?php echo $question->post_title ?></a>
137137

138-
<!-- this will need to also grab sub-groups too if Qs are empty, crawl downward -->
139138
</li>
140139
<?php endforeach; ?>
141140

@@ -165,15 +164,15 @@
165164

166165
</details>
167166

168-
<?php echo apply_filters( 'the_content', $group->post_content ); ?>
169-
167+
<?php if (!$children) : ?>
170168
<?php foreach ($questions as $question) : ?>
171169

172170
<h3 id="<?php echo (str_replace(' ', '-', strtolower($question->post_title))); ?>"><?php echo $question->post_title ?></h3>
173171
<a href="<?php echo get_edit_post_link($question->ID); ?>" class="edit" >[edit]</a>
174172
<?php echo apply_filters( 'the_content', $question->post_content ); ?>
175173

176174
<?php endforeach; ?>
175+
<?php endif; ?>
177176

178177
<?php
179178
$args = array(

0 commit comments

Comments
 (0)