Adele
asked 4 years ago

There used to be a login box at the bottom of each question page so that you could login and answer the question from the same page, but this has disappeared eg. http://www.plasticsurgeryhub.com.au/question/implants-and-tummy-tuck/
The text box to answer the question only appears when we have logged into the site via the regular WordPress login. But we want people to be able to go directly to the question, login and answer the question from there.

4 Answers
DominicStaff
answered 4 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

}

}
?>

Hope this helps!

Adele
answered 4 years ago

This doesn’t seem to work, I’m getting all sorts of syntax errors?

DominicStaff
answered 4 years ago

Please send me username & password of your site for further checking, I have checked on our demo and it still works fine.

DominicStaff
answered 4 years ago

I have helped you resolve this issue, you can check your site now.

Dominic Staff
replied 4 years ago

I have added the following code to the style.css file of the Divi theme But, it does not work, I think issue come from cache site, you can clear cache or 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

Adele Joy
replied 4 years ago

Thanks, we are using a child theme so I’ve added the code to that stylesheet. I needed to remove the register link from the php code as we don’t want anyone to register to answer the questions, but it is all working nicely now. Thanks 🙂

Dominic Staff
replied 4 years ago

If you have any issue or question, you can let me know, I will check and help you resolve it.

Powered by DW Question & Answer Pro