Laurent Alquier
asked 3 years ago

Is it possible to set a Question category by default in the New Question form?

I would like the selection to be set to ‘Questions’ by default instead of ‘Select a category’,

1 Answers
answered 3 years ago

To set a question category by default, you can go to your theme folder and create a new folder , named it dwqa-templates.
Inside your new folder, create a new file: question-submit-form.php.
Now, open up the new file in notepad or any code editor, and copy/paste the code at this link:

Then find the line 41:
'selected' => isset( $_POST['question-category'] ) ? $_POST['question-category'] : false,

Replace with the following code:
'selected' => Your Categories ID

Note: You can find your categories ID In backend, when you edit a category, you will see your category ID in the URL on your browser address bar which looks like this: …&tag_ID=

Hope this helps!

Powered by DW Question & Answer Pro