kyleafly
asked 6 years ago

Some of my questions and answers have not author assigned to them. In our DWQA settings, only registered users can post questions and answers.
Any idea what’s happening?
 

3 Answers
DominicStaff
answered 6 years ago

Please send me username & password of your site for further checking. I have checked the plugin on our demo and see that the plugin still work fine.

kyleafly
answered 6 years ago

I figured it out Dominic. 
My registration form doesn’t have First and Last Name (using Ultimate Member plugin) it just has Username. By default WordPress will set the “Display name publicly as” field to the First and Last name. But since we don’t have those fields, it’s set to just be blank.

Is there a way to have DWQA use the Username as the name that’s displayed as the Author? Thanks!

Dominic Staff
replied 6 years ago

To show the username, you can create a folder “dwqa-templates” in the folder theme then go to the wp-content/plugins/dw-question-answer/templates
then copy/paste the
content-single-question.php, content-single-answer.php, content-question.php, content-comment.php files into “dwqa-templates” folder.
Open the files find the following code:

get_the_author()

And replace with the following code:

get_the_author_meta( ‘nickname’, $author_id )

kyleafly
replied 6 years ago

Thank you Dominic. This works on the single question page, but how do I make this work on the Qusetions page which lists all of the questions?

Dominic Staff
replied 6 years ago

you can change in the content-question.php

kyleafly
answered 6 years ago

Dominic, when I replace the code on the content-question.php file, it doesn’t change to nickname. In fact, all the author names disappear completely. 

kyleafly
replied 6 years ago

Figured it out, when I copied your code it gave me the wrong single quote mark. It was curly instead of straight.

This is resolved.

Dominic Staff
replied 6 years ago

Yes, if you have any issue or question, you can let me know. We will help you resolve it.

Powered by DW Question & Answer Pro