Support » Plugins » WP 2.7 Threaded Comments – Link to Parent Comment?

  • I’m trying to integrate the threaded comments into my current theme. I would like to display a link to the parent comment inside the child comment but I don’t think there is a template tag that will do this. I wrote the following little snippet which I placed inside my theme’s functions.php file:

    function cuteness_parent_link() {
    	global $comment;
    	$parentId = $comment->comment_parent;
    	if (0 == $parentId)
    	$commentOrig = $comment;
    	$comment = get_comment($parentId);
    	echo 'replied to <a href="#comment-' . get_comment_ID() . '">' . get_comment_author() . '</a>';
    	$comment = $commentOrig;

    Is there a better way of doing this? I’m really not familiar with the inner workings of WP. Any input will be appreciated 🙂

Viewing 1 replies (of 1 total)
  • Hi..i am also looking for the same functioning…I will try out your code..thanks a lot for posting it here…If i have a solution i will post back

Viewing 1 replies (of 1 total)
  • The topic ‘WP 2.7 Threaded Comments – Link to Parent Comment?’ is closed to new replies.