WP 2.7 Threaded Comments - Link to Parent Comment? (2 posts)

  1. bubblessoc
    Posted 7 years ago #

    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 :)

  2. idcoder
    Posted 7 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic