Jenny In Wanderland
asked 5 years ago

On the list questions page, using the dwqa-list-questions shortcode, the “Ask Question” button only appears if the user is already logged in.  When the user is logged in, the “Ask Question” button appears and takes them to the page with the dwqa-submit-question-form shortcode as expected.
When the user is not logged in and they go to the page with the dwqa-submit-question-form shortcode, it prompts them to login or register as expected.
The Ask Question button should show up on the dwqa-list-questions shortcode page, whether user is logged in or not, allowing the dwqa-submit-questions-form shortcode page to log in and register them as needed (and then allow them to ask their question)…How can I make this happen?

1 Answers
DominicStaff
answered 5 years ago

At the moment, you can customize the template file of the plugin. 
Please download the following folder then add to your theme folder: https://www.dropbox.com/s/2g0fywfvub971er/dwqa-templates.zip?dl=0
Then go to the plugins/dw-question-answer-pro/templates/styles/default and copy the archive-question.php file and paste into the themes/your-theme/dwqa-templates/styles/my-style folder. 
And find the following code: 

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

Replace with the following code: 

<div class="dwqa-ask-question"><a href="<?php echo dwqa_get_ask_link(); ?>"><?php _e( 'Ask Question', 'dwqa' ); ?></a></div>

After editing the file, you need to go to the Dashboard > Questions > Settings then select the my-stylein the Style section.

Powered by DW Question & Answer Pro