Title: Comments.php Problem
Last modified: August 30, 2016

---

# Comments.php Problem

 *  Resolved [A](https://wordpress.org/support/users/mrex778/)
 * (@mrex778)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/commentsphp-problem-1/)
 * Hi
    I have problem with comments.php file. The problem is that I can’t make my
   own style 😐 so here’s comment style that I want:
 *     ```
       <h4 class="m-t-lg m-b">4 Comments</h4>
                         <section class="comment-list block">
                           <article id="comment-id-1" class="comment-item">
                             <a class="pull-left thumb-sm">
                               <img alt="Avatar" src="images/a0.png" class="img-circle">
                             </a>
                             <section class="comment-body m-b">
                               <header>
                                 <a href="#"><strong>Lord Artimos</strong></a>
                                 <label class="label bg-info m-l-xs">Admin</label>
                                 <span class="text-muted text-xs block m-t-xs">
                                   25min ago
                                 </span>
                               </header>
                               <div class="m-t-sm">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus aliquam velit ornare ante finibus, id lobortis ligula semper. Sed nec tincidunt nunc.</div>
                             </section>
                           </article>
                         </section>
   
                         <h4 class="m-t-lg m-b">Leave a comment</h4>
                         <form>
                           <div class="form-group pull-in clearfix">
                             <div class="col-sm-6">
                               <label>Name:</label>
                               <input type="text" class="form-control" placeholder="Name">
                             </div>
                             <div class="col-sm-6">
                               <label >Email:</label>
                               <input type="email" class="form-control" placeholder="Email">
                             </div>
                           </div>
                           <div class="form-group">
                             <label>Comment:</label>
                             <textarea class="form-control" rows="5" placeholder="Write your comment"></textarea>
                           </div>
                           <div class="form-group">
                             <button type="submit" class="btn btn-success">Post Comment</button>
                           </div>
                         </form>
       ```
   
 * Now I don’t know how to make these on comments.php file also I tried to copy 
   other comments.php file with their style but again I can’t find out how does 
   it work and I can’t use this code:
 *     ```
       <?php if ( is_user_logged_in() ) : ?>
   
           <p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Logout from this account">Logout »</a></p>
           <?php else : ?>
       ```
   
 * And when I delete this part, the comments won’t work anymore.
    ….. Plz help me

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

 *  Moderator [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * (@jcastaneda)
 * THEME COFFEE MONKEY
 * [10 years, 3 months ago](https://wordpress.org/support/topic/commentsphp-problem-1/#post-6842132)
 * Hi there!
 * First, let us worry about the structure of your HTML, shall we? If I understand
   correctly, you want to create your own markup for the comment list as well as
   the comment form? I say this only because you have one comment and you also have
   the inputs in the markup. If this is correct there are two things that you are
   dealing with on this. The first one is the use of `wp_list_comments()`. The second(
   which deals with the comment form ) is using `comment_form()`.
 * For the first hurdle, if you wanted to create your comment listing you can use
   the `wp_list_comments()` callback argument. In the comments file you would have
   something like:
 *     ```
       wp_list_comments( array( 'callback' => 'my_cool_comment_list' ) );
       ```
   
 * Then in your functions file of the theme you would have something like:
 *     ```
       function my_cool_comment_list(){
           // HTML markup for list
       }
       ```
   
 * Then for the `comment_form()` you can use a filter for that as well:
    [https://codex.wordpress.org/Function_Reference/comment_form](https://codex.wordpress.org/Function_Reference/comment_form)
 * Sorry, I would love to post some sample code but I have to get back to work. 
   Apparently they want people to be active when you come back from your lunch break.
 * Hope that does give you a little more information and help you out. If not, please
   don’t hesitate to ask!
 *  Thread Starter [A](https://wordpress.org/support/users/mrex778/)
 * (@mrex778)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/commentsphp-problem-1/#post-6842134)
 * Thanks that was helpful.

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

The topic ‘Comments.php Problem’ is closed to new replies.

## Tags

 * [comment](https://wordpress.org/support/topic-tag/comment/)
 * [comment-problem](https://wordpress.org/support/topic-tag/comment-problem/)
 * [Comments](https://wordpress.org/support/topic-tag/comments/)
 * [comments.php](https://wordpress.org/support/topic-tag/comments-php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [A](https://wordpress.org/support/users/mrex778/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/commentsphp-problem-1/#post-6842134)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
