Advertisement
morpe

wp_list_comments

Sep 7th, 2012
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.07 KB | None | 0 0
  1. function comment_display($comment, $args, $depth)
  2. {
  3.  
  4.     if( $comment->comment_approved == 1 )
  5.     {
  6.         $add_style="class='is-comment'";
  7.  
  8.         if( $depth != 1 )
  9.         {
  10.             $_d = $depth*4;
  11.             $_w = 718 - $_d;
  12.             $add_style="class=**is-reply** style=**position:relative; left:".$_d."; width:$_w;**";
  13.             $add_style = str_ireplace('**', "'", $add_style);
  14.         }
  15.  
  16.         echo "\n<!-- ------------------------- $comment->comment_ID ---------------------- -->\n";
  17.         echo "\t<div $add_style>\n";
  18.         echo "\t\t<div class='c-id c-item c-first'>".$comment->comment_ID."</div>\n";
  19.         echo "\t\t<div class='c-author c-item'>".$comment->comment_author."</div>\n";
  20.         echo "\t\t<div class='c-text c-item c-last'>".$comment->comment_content."</div>\n";
  21.         echo "\t</div>\n\n";
  22.     }
  23. }
  24.  
  25. $args = array(  'walker' => null,
  26.                 'max_depth' => '',
  27.                 'style' => "",
  28.                 'callback' => comment_display,
  29.                 'end-callback' => "",
  30.                 'type' => 'all',
  31.                 'page' => '',
  32.                 'per_page' => '',
  33.                 'avatar_size' => 32,
  34.                 'reverse_top_level' => null,
  35.                 'reverse_children' => ''
  36.                 );
  37.  
  38. wp_list_comments($args);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement