• 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

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Can you show us the web page in which this occurs?

    Thread Starter morpe

    (@morpe)

    hi!!

    I’m working locally, here are a couple of screenshots:
    http://d.pr/i/7TWi
    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.