Colin
asked 2 weeks ago

Hi,
I have set up a Category structure, but there doesn’t seem to be a way to have subcategories listed under their parents, or show any formatting for subcategories.  All categories seem to have the class level-0.
I have version 1.21 – is that the latest?
 

1 Answers
DominicStaff
answered 2 weeks ago

At the moment, the plugin does not support to show the sub-categories. If you want to show the sub-categories.  Please copy the template question-submit-form.php at wp-content/plugins/dw-question-answer-pro to wp-content/themes/your-theme-folder/dwqa-templates then replace the code below from

wp_dropdown_categories( array(
	'name'          => 'question-category',
	'id'            => 'question-category',
	'taxonomy'      => 'dwqa-question_category',
	'show_option_none' => __( 'Select question category', 'dwqa' ),
	'hide_empty'    => 0,
	'quicktags'     => array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close' ),
	'selected'      => isset( $_POST['question-category'] ) ? sanitize_text_field( $_POST['question-category'] ) : false,
) );

to

wp_dropdown_categories( array(
	'name'          => 'question-category',
	'id'            => 'question-category',
	'taxonomy'      => 'dwqa-question_category',
	'show_option_none' => __( 'Select question category', 'dwqa' ),
	'hide_empty'    => 0,
	'quicktags'     => array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close' ),
	'selected'      => isset( $_POST['question-category'] ) ? sanitize_text_field( $_POST['question-category'] ) : false,
	'hierarchical'  => true,
) );
Powered by DW Question & Answer Pro