That’s the message I get when when I try to ask a question as anonymous. How can I make it ask the anonymous user to login or register instead?
I tried adding this code to the single-question.php file but then, the questions refused to display
<?php
if ( dwqa_current_user_can( 'post_answer' ) ) {
dwqa_load_template( 'answer', 'submit-form' );
} else { ?>
<?php if ( is_user_logged_in() ) { ?>
<div class="alert"><?php _e( 'You do not have permission to submit answer.','dwqa' ) ?>
<?php } else { ?>
<h3 class="dwqa-title">
<?php
printf( '%1$s <a href="%2$s" title="%3$s">%3$s %4$s', **( 'Please login or', 'dwqa' ), wp_registration_url(), **( 'Register', 'dwqa' ), __( 'to Submit Answer', 'dwqa' ) );
?>
<div class="login-box">
<?php wp_login_form( array( 'redirect' => get_post_permalink( $question_id ) ) ); ?>
<?php
}
}
?>
Pls help
Hi, so sorry for my late reply, have you go to dashboard >> Question >> settings >> permission and check the permission for anonymous to post question ?
Yes, when I do that, it allows anonymous users to post questions. But I want it to ask them to register first before they can post. I don’t want anonymous users posting questions.
well you can uncheck that permission. If you use the pro version of the DW Q&A, the login form well be shown, how ever if you use the free version, only a notice will show that they not have permission to ask question.
Alright Allen. Thanks for your timely response.
Hi, this link to question can help you add the login form to the single question page :
https://www.designwall.com/question/login-option-is-missing-on-the-single-question-page-how-do-i-add-it/
and to add question login form to the ask question page, you can replace file : dw-question-answer/templates/question-submit-form.php with this code from here :
http://pastebin.com/cC207Qzi
Thanks again allen. I’ll try it out and get back to you.
Are you saying I should replace the code in this file (dw-question-answer/templates/question-submit-form.php) with the code from the pastebin link u provided? Should I replace the entire code? Or just a portion of it
Yes you can replace the entire code.
Hi,
I use the Pro version and I tried unchecking that option but no login form is shown. Can you please help me?
I will answer your question here: https://www.designwall.com/question/anonymous-user-wont-receive-email-if-question-is-private/
(dw-question-answer/templates/question-submit-form.php) – where is this directory located? i dont see the dw-question-answer folder in the directory.
(dw-question-answer/templates/question-submit-form.php) – where is this directory located? i dont see the dw-question-answer folder in the directory.
Please login or Register to submit your answer