PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 3.8.2
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v3.8.2
4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 All 200 releases
betterdocs / views / shortcode-parts / faq-list.php

faq-list.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 3.8.2, at views/shortcode-parts/faq-list.php

36 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 $faqs = betterdocs()->query->get_faq_by_term( $term->term_id );
4
5 if ( $faqs->have_posts() ) {
6 echo '<ul class="betterdocs-faq-list">';
7
8 $faq_markup = '';
9 while ( $faqs->have_posts() ): $faqs->the_post();
10 echo '<li>';
11 echo '<div class="betterdocs-faq-group">';
12 $view_object->get( 'shortcode-parts/faq-title' );
13 $view_object->get( 'shortcode-parts/faq-content' );
14 echo '</div>';
15 echo '</li>';
16
17 if ( $faq_schema ) {
18 $faq_json = [
19 '@type' => 'Question',
20 'name' => get_the_title(),
21 'acceptedAnswer' => [
22 '@type' => 'Answer',
23 'text' => get_the_content()
24 ]
25 ];
26 $GLOBALS['betterdocs_faq_schema_main_entity'][] = $faq_json;
27 }
28 endwhile;
29 wp_reset_postdata();
30 wp_reset_query();
31 echo $faq_markup;
32 echo '</ul>';
33 } else {
34 echo '<p>' . __( 'Sorry, no FAQ matched your criteria.', 'betterdocs' ) . '</p>';
35 }
36