Hi, is possible to hook the displayed username (when we read a “topic”) ?
Thank you (DWQA Free).
Firstly, if you want to show the username of author question in the single question, you can create the dwqa-templates folder in the theme folder then copy the content-single-question.php file in the wp-content/plugins/dw-question-answer/templates folder and paste into the dwqa-templates folder to custom.
However, if you want to display the author name in another position, you can send me a screenshot of the position that you wish. I will check and help you.
In content-single-answer, I don’t want display the author (I use alternative method). I tried to deleted “get_the_author(),” in this line :
<?php printf( __( '%s%s %s answered %s ago’, ‘dw-question-answer’ ), dwqa_get_author_link( $user_id ), get_avatar( $user_id, 48 ), get_the_author(), dwqa_print_user_badge( $user_id ), human_time_diff( get_post_time( ‘U’, true ) ) ) ?>
But it returns me error : Warning: printf(): Too few arguments in /datas/vol2//var/www//htdocs/wp-content/themes/dwqa-templates/content-single-answer.php on line 78
How can I hide Pseudo (I tried CSS display: none but it hide avatar also).
If you want to hide the author name, you can replace it width the following code:
<?php printf( __( '<span><a href="%s">%s</a> asked %s ago</span>', 'dw-question-answer' ), dwqa_get_author_link( $user_id ), get_avatar( $user_id, 48 ), human_time_diff( get_post_time( 'U', true ) ) ) ?>
Please login or Register to submit your answer