Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

wcten on "Comment Template"

$
0
0

How do I make a new comment template that when I click on the user name, and it link me to the page that will show all the comments made by that particular user?

I have the following code that show only admin's comments.

<?php
/*
Template Name: Comments Template
*/
?>
<?php get_header(); ?>
<div class="content-wrap">
	<div class="content">
		<?php tie_breadcrumbs() ?>

		<?php
$args = array(
	'user_id' => 1, // use user_id

);
$comments = get_comments($args);
foreach($comments as $comment) :
	echo($comment->comment_author . '<br />' . comment_excerpt( $comment_ID ));
endforeach;

?>

<?php get_sidebar(); ?>
<?php get_footer(); ?>

Viewing all articles
Browse latest Browse all 8245

Trending Articles