Hello I’ve created a custom author.php file for my wordpress site. how can I list all of the user questions and answers and comments in this page? which code should I use?
I finally found the code that I want!
to list all of questions:
<ul>
<?php
$curauth = (isset($_GET[‘author_name’])) ? get_user_by(‘slug’, $author_name) : get_userdata(intval($author));
query_posts( array(
‘post_type’ => array(‘dwqa-question’),
‘author’ => $author )
);
?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li>
<a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link: <?php the_title(); ?>”><?php the_title(); ?></a>
</li>
<?php endwhile; else: ?>
<p>no questions found</p>
<?php endif; ?><?php wp_reset_query(); ?>
</ul>
and to list answers:
<ul>
<?php
$curauth = (isset($_GET[‘author_name’])) ? get_user_by(‘slug’, $author_name) : get_userdata(intval($author));
query_posts( array(
‘post_type’ => array(‘dwqa-answer’),
‘author’ => $author )
);
?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li>
<a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link: <?php the_title(); ?>”><?php the_title(); ?></a>
</li>
<?php endwhile; else: ?>
<p>no answers found</p>
<?php endif; ?><?php wp_reset_query(); ?>
</ul>
Hi,
Thanks for pointing on our question & answer forum ! Unfortunately, the DW Q&A plugin does not yet support a author page.
However, you can use Member list plugin to help you out. Please find the plugin here:https://wordpress.org/plugins/members-list/
Try it and let us know your experience, my friend 🙂
I don’t want to list users! I want to list questions of user.. There should be a php code which shows the questions that a user has asked.
Please read more about WordPress Query here:Â http://codex.wordpress.org/Class_Reference/WP_Query
sorry but I don’t have any information about this link. in designwall.com there’s a user profile which shows all of the things I’m searching for. is it possible that you add these features in your next version of plugin?
You can use buddypress and the custom code from DW to make a listing of all the questions an author/contributor has asked
isn’t there anyway to use it in WordPress without buddypress?
Did anything ever get done with this?
Please login or Register to submit your answer