asked 5 years ago

Can you help me, how to give limit for length of slug question.
For example : i want to give limit length url for 15 word, for any question.
Or give limit for 80 character.

1 Answers
answered 5 years ago

At the moment, the plugin does not support to limit the length of the slug question. However, I think you should limit the Question title when submitting a question.
If you want to limit the title, you can open the question-submit-form.php file in the templates/styles/default folder then replace the line code 17 to 22 with the following code:

<form method="post" class="dwqa-content-ask-form" id="form_elem">
<p class="dwqa-search">
<label for="question_title"><?php _e( 'Title', 'dwqa' ) ?></label>
<?php $title = isset( $_POST['question-title'] ) ? $_POST['question-title'] : ''; ?>
<input type="text" data-nonce="<?php echo wp_create_nonce( '_dwqa_filter_nonce' ) ?>" id="question-title" maxlength="70" name="question-title" value="<?php echo $title ?>" tabindex="1">
<span id="error_msg" style="color:red"></span>
<script type="text/javascript">
var inputStr = $("#question-title").val();
$("#error_msg").html("enter atleast 5 chars in the input box");
Dominic Staff
replied 5 years ago

If you want to custom the plugin and safe in the next update, you can download the following file then add the folder to your theme folder.

Powered by DW Question & Answer Pro