Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Sample FAQ view file
$args = array(
'post_type' => 'faq',
'posts_per_page' => -1,
'tax_query' => array(
'taxonomy' => 'faq_category',
'field' => 'id',
'terms' => explode(',', $attrs['include_categories']),
$query = new WP_Query($args);
while ($query->have_posts()) {
echo sprintf("<h6 class='%s'>%s</h6>", $attrs['question_class'], get_the_title());
echo sprintf("<p class='%s'>%s</p>", $attrs['answer_class'], apply_filters('the_content', get_the_content()));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.