Miguel
asked 4 years ago

What arguments do I have to pass a wp_query to get the questions posted or answered by a certain user?
I’ve tried many combinations like the one below but I don’t seem to get it right.
 
$author_id = get_the_author_meta( ‘ID’ );
$args = array(
‘post_type’ => ‘dwqa-question’,
‘post_status’ => ‘publish’,
‘posts_per_page’ => 5,
$latest_activity[‘user_id’] => $author_id,
‘tax_query’ => array(
array(
‘taxonomy’ => ‘latest_activity’,
‘field’    => ‘user_id’,
‘terms’    => $author_id,
),
),
);

1 Answers
DominicStaff
answered 4 years ago

At the moment, you can use the following code to show the question and answer of the user.

                      <div class="dwqa-user-qa">
                   <?php echo __('Questions', 'dwqa')?>(<?php echo dwqa_count_user_question($user_id);?>)
                  <?php dwqa_profile_tab_questions(); ?>
                 

                   <?php echo __('Answers', 'dwqa')?>(<?php echo dwqa_count_user_answer($user_id);?>)
                  <?php dwqa_profile_tab_answers(); ?>
                </div>
Powered by DW Question & Answer Pro