testingtestedtests
asked 7 years ago

Hi, I just started using DW Q&A, and as of now i have set the ‘question list’ and ‘ask a question’ pages. I cant find the way to registers users (i want people to be logged for asking questions). Does the plug-in have the feature? Or how can I register/manage users? 
Thanks in advance

1 Answers
DominicStaff
answered 7 years ago

To resolve this issue, you can log into Dashboard > Question > Settings > Permission and disable the post option for all the User role.
Then go to the Folder theme and create a new folder with the name “dwqa-templates” and create a new file in this folder with the name “archive-question.php” then add the following code to this file:

<?php
/**
* The template for displaying question archive pages
*
* @package DW Question & Answer
* @since DW Question & Answer 1.0.1
*/
?>
<div class=”dwqa-questions-archive”>
<?php do_action( ‘dwqa_before_questions_archive’ ) ?>

<div class=”dwqa-questions-list”>
<?php do_action( ‘dwqa_before_questions_list’ ) ?>
<?php if ( dwqa_has_question() ) : ?>
<?php while ( dwqa_has_question() ) : dwqa_the_question(); ?>
<?php if ( get_post_status() == ‘publish’ || ( get_post_status() == ‘private’ && ( dwqa_current_user_can( ‘edit_question’, get_the_ID() ) || dwqa_current_user_can( ‘manage_question’ ) || get_current_user_id() == get_post_field( ‘post_author’, get_the_ID() ) ) ) ) : ?>
<?php dwqa_load_template( ‘content’, ‘question’ ) ?>
<?php endif; ?>
<?php endwhile; ?>
<?php else : ?>
<?php dwqa_load_template( ‘content’, ‘none’ ) ?>
<?php endif; ?>
<?php do_action( ‘dwqa_after_questions_list’ ) ?>
</div>
<div class=”dwqa-questions-footer”>
<?php dwqa_question_paginate_link() ?>
<?php if ( dwqa_current_user_can( ‘post_question’ ) ) : ?>
<div class=”dwqa-ask-question”><a href=”<?php echo dwqa_get_ask_link(); ?>”><?php _e( ‘Ask Question’, ‘dwqa’ ); ?></a></div>
<?php elseif ( ! is_user_logged_in() ) : ?>
<div class=”dwqa-answers-login”>
<div class=”dwqa-answers-login-title”>
<p><?php printf( __( ‘Please login or %1$sRegister%2$s to submit your answer’, ‘dwqa’ ), ‘<a href=”‘.wp_registration_url().'”>’, ‘</a>’ ) ?></p>
</div>
<div class=”dwqa-answers-login-content”>
<?php wp_login_form(); ?>
<?php do_action( ‘wordpress_social_login’ ); ?>
</div>
</div>
<?php endif; ?>
</div>
<?php do_action( ‘dwqa_after_questions_archive’ ); ?>
</div>

Powered by DW Question & Answer Pro