Title: how to format php   wp_list_comments( ) ?
Last modified: August 19, 2016

---

# how to format php wp_list_comments( ) ?

 *  Resolved [sandeep4688](https://wordpress.org/support/users/sandeep4688/)
 * (@sandeep4688)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/how-to-format-php-wp_list_comments/)
 *     ```
       <ol class="commentlist">
       <?php wp_list_comments(); ?>
       </ol>
       ```
   
 * Somebody pls. tell me how to format above.( name, comments and pic).

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

 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/how-to-format-php-wp_list_comments/#post-1394619)
 * See here regarding using a custom callback.
    [http://codex.wordpress.org/Template_Tags/wp_list_comments#Comments_Only_With_A_Custom_Comment_Display](http://codex.wordpress.org/Template_Tags/wp_list_comments#Comments_Only_With_A_Custom_Comment_Display)
 *  [kdesign](https://wordpress.org/support/users/kdesign/)
 * (@kdesign)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/how-to-format-php-wp_list_comments/#post-1394792)
 * Hi t31os,
 * I’m experiencing the same dilemma. Is a custom callback the only way to do it?
   I am trying to have my comments look like the comments in this blog: [http://www.justinmarantz.com/](http://www.justinmarantz.com/)(
   you may need to scroll down to the end of a post to see it).
 * Currently my comments have the name, a break, a comment, another break, and the
   date. But I’d like mine to have the same order as the comments in that blog. 
   To change the order, will you need to create a custom callback?
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/how-to-format-php-wp_list_comments/#post-1394793)
 * If you want control over the elements output by wp_list_comments, then yes, as
   far as i know, a custom callback is the only way to do it.
 * The alternative would be to write your own query to the database to get the data,
   and do your own stuff with it from there.
 * The callback being the easier option..
 *  [kdesign](https://wordpress.org/support/users/kdesign/)
 * (@kdesign)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/how-to-format-php-wp_list_comments/#post-1394794)
 * Hi, I tried it and understand it, but for some reason can’t figure out why I 
   keep getting an error message.
 * Basically, I have an originally empty functions.php file in which I copied and
   pasted what is in the Codex as you’ve linked above. Then I modified comments.
   php with
 * <ul class=”commentlist”>
    <?php wp_list_comments(‘type=comment&callback=mytheme_comment’);?
   >
 * in replacement of
 * <ul class=”commentlist”>
    <?php wp_list_comments(); ?>
 * Whenever I update functions.php I keep receiving this error though:
 * Parse error: syntax error, unexpected ‘}’ in /home7/kd/public_html/wp-content/
   themes/ejstheme/functions.php on line 26
 * Have you ever experienced this? Any help would be much appreciated! And if it
   helps, I’m using version 2.9.2.
 * Thanks.
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/how-to-format-php-wp_list_comments/#post-1394795)
 * If you’ve copied the example “as is”, you’ll need to make a small adjustment..
 * Open your functions file, and adjust the top lines to look like so..
 *     ```
       <?php
       function mytheme_comment($comment, $args, $depth) {
       ```
   
 * That should be it.. 😉
 *  [kdesign](https://wordpress.org/support/users/kdesign/)
 * (@kdesign)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/how-to-format-php-wp_list_comments/#post-1394796)
 * thanks, it worked. styling it is another story though! it’s still not as straightforward
   as i thought it would be. i’m trying to wrap the comment around the author name
   which is more difficult than i thought since ‘comment author vcard’ is in a div
   and comment_text() spits out a paragraph in the html that i can’t get to wrap.
   i assumed i could apply a ‘float: left;’ property to the comment author vcard
   div class (or cite, .fn–trying different things) but nothing productive yet. 
   Ah, it never ends! I’ll have to figure more ways to style comments. Thanks for
   your help. 🙂
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/how-to-format-php-wp_list_comments/#post-1394797)
 * If you’re able to post a URL to the page, perhaps myself or another user may 
   be able to suggest some CSS tweaks to help you along…

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

The topic ‘how to format php wp_list_comments( ) ?’ is closed to new replies.

## Tags

 * [comments list](https://wordpress.org/support/topic-tag/comments-list/)
 * [formatting](https://wordpress.org/support/topic-tag/formatting/)

 * 7 replies
 * 3 participants
 * Last reply from: [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/how-to-format-php-wp_list_comments/#post-1394797)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
