how to display user’s question and answer

5.63K viewsGeneral
0

Hello,

I’ve created a custom author.php file for my wordpress site to show user’s commnets,article,questions and answers

how can I list all of the user questions and answers and comments in this page?

which code should I use?
thanks!

1

Hello,

Use this code:

global $questions;
$args = [];
$args['ap_current_user_ignore'] = true;
$args['author'] = (int) get_query_var( 'ap_user_id' );
anspress()->questions = $questions = new Question_Query( $args );
include ap_get_theme_location( 'addons/user/questions.php' );

You are viewing 1 out of 2 answers, click here to view all answers.