Title: comment template
Last modified: August 20, 2016

---

# comment template

 *  [morpe](https://wordpress.org/support/users/morpe/)
 * (@morpe)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/comment-template-1/)
 *     ```
       function comment_display($comment, $args, $depth)
       {
   
       	if( $comment->comment_approved == 1 )
       	{
       		$add_style="class='is-comment'";
   
       		if( $depth != 1 )
       		{
       			$_d = $depth*4;
       			$_w = 718 - $_d;
       			$add_style="class=**is-reply** style=**position:relative; left:".$_d."; width:$_w;**";
       			$add_style = str_ireplace('**', "'", $add_style);
       		}
   
       		echo "\n<!-- ------------------------- $comment->comment_ID ---------------------- -->\n";
       		echo "\t<div $add_style>\n";
       		echo "\t\t<div class='c-id c-item c-first'>".$comment->comment_ID."</div>\n";
       		echo "\t\t<div class='c-author c-item'>".$comment->comment_author."</div>\n";
       		echo "\t\t<div class='c-text c-item c-last'>".$comment->comment_content."</div>\n";
       		echo "\t</div>\n\n";
       	}
       }
   
       $args = array(	'walker' => null,
       				'max_depth' => '',
       				'style' => "",
       				'callback' => comment_display,
       				'end-callback' => "",
       				'type' => 'all',
       				'page' => '',
       				'per_page' => '',
       				'avatar_size' => 32,
       				'reverse_top_level' => null,
       				'reverse_children' => ''
       				);
   
       wp_list_comments($args);
       ```
   
 * wp_list_comments adds the unnecessary tag UL, OL or Div
    as I do to stop them
   from print?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [13 years, 9 months ago](https://wordpress.org/support/topic/comment-template-1/#post-3020768)
 * Can you show us the web page in which this occurs?
 *  Thread Starter [morpe](https://wordpress.org/support/users/morpe/)
 * (@morpe)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/comment-template-1/#post-3020799)
 * hi!!
 * I’m working locally, here are a couple of screenshots:
    [http://d.pr/i/7TWi](http://d.pr/i/7TWi)
   [http://d.pr/i/1bpn](http://d.pr/i/1bpn) (html)
 * arrows indicate more tags generated by wp_list_comments ();
    and class Walker(
   includes / comment-template.php)
 * my code works, he does not need those tags,
    and $args[‘style’] = ‘div’; Add 
   unnecessary Div.
 * tnx!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘comment template’ is closed to new replies.

## Tags

 * [Comments](https://wordpress.org/support/topic-tag/comments/)
 * [Themes](https://wordpress.org/support/topic-tag/themes/)
 * [wp_list_comments](https://wordpress.org/support/topic-tag/wp_list_comments/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [morpe](https://wordpress.org/support/users/morpe/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/comment-template-1/#post-3020799)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
