The first step integrate DW Q&A plugin with your themes follow steps
- Create a new “dwqa-templates” folder
Go to your theme folder wp-content/themes/your-theme-folder folder and create a new folder named “dwqa-templates”. - Past DW Q&A templates to newly created folder
Go to the /wp-content/plugins/dw-question-answer/templates and copy all file and past into /wp-content/themes/your-theme-folder/dwqa-templates
The second step add a login form to question page
- Go to the /wp-content/themes/your-theme-folder/dwqa-templatesanswers.php
- Go to line no 28 and replace <?php else: ?> with below code
<?php else: $args = array( 'echo' => true, 'remember' => true, 'redirect' => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'form_id' => 'loginform', 'id_username' => 'user_login', 'id_password' => 'user_pass', 'id_remember' => 'rememberme', 'id_submit' => 'wp-submit', 'label_username' => __( 'Username' ), 'label_password' => __( 'Password' ), 'label_remember' => __( 'Remember Me' ), 'label_log_in' => __( 'Log In' ), 'value_username' => '', 'value_remember' => false ); wp_login_form($args); endif; ?>
Now user show login message when user trying to give the answer without login
If you give the register button then past below code
<?php '<a href="'.wp_registration_url().'"><input type="button" class="button button-primary" value="Register"></a>' ?>