Bhuboy Villanueva
asked 8 years ago

Hi, i have just installed your plug in, everything is almost fine. At the moment i set it up that anonymous can post question, because when i set it up that they cant and i try to ask question without logging in, there is no registraion link or tab

1 Answers
DominicStaff
answered 8 years ago

At the moment, we have disable temporary this option in the latest version. If you want to display the login/register link in the single question, you can open the single-question.php file in the templates folder and add the following code under line 20.

<?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

}

}

?>

Then copy this code(at the final of the file) and paste into another style.css or the CSS Edit tool that you using.
http://snippi.com/s/monhsby
If you still face their issue. you can send me username & password of your site, I will help add the code.
Note: If you don’t want the custom lost when you update the latest version, you go to your theme folder and create a new folder , named it "dwqa-templates" .
Inside your new folder, copy/paste the the single-question.php file into the "dwqa-templates" folder and add the code that I have provided.
Hope this helps!

Powered by DW Question & Answer Pro