Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*==================================================================
- comments.php
- ===================================================================*/
- <?php comment_ID(); ?> //the ID of a comment
- <?php comment_type(); ?> //the type of comment; pingback, trackback or a comment
- <?php comment_text(); ?> //the actual comment
- <?php comment_date(); ?> //the date it was posted
- <?php comment_time(); ?> //the time it was posted
- <?php comment_author(); ?> //the author of a comment
- <?php comment_author_link(); ?> //the author of a comment, wrapped with a link to his website if he specified one
- <?php edit_comment_link(__('edit comment'), '<p>', '</p>'); ?> //Displays Edit Comment in Paragraph Tag
- <?php echo allowed_tags(); ?> //Displaying the allowed tags
- <?php echo get_avatar( get_comment_author_email(), $size, $default_avatar ); ?> //the author avater
- <?php comments_number('No comments', 'One comment', '% comments'); ?> //Comment numbers for title
- <?php comments_popup_link('No comments', 'One comment', '% comments', 'comments-link', 'Comments are closed'); ?> //To display a link to the comments part (with the number of comments displaying aswell)
- /*==================================================================
- Displaying The Comments
- ===================================================================*/
- <?php if($comments) : ?> //checks if there are comments
- <ol>
- <?php foreach($comments as $comment) : ?> //loops through comments
- <li id="comment-<?php comment_ID(); ?>">
- <?php if ($comment->comment_approved == '0') : ?> //checks if the comment has been approved
- <p>Your comment is awaiting approval</p><!--shows a message if it's not yet approved-->
- <?php endif; ?>
- <?php echo get_avatar( get_comment_author_email(), $size, $default_avatar ); ?>
- <?php comment_text(); ?>
- <cite><?php comment_type(); ?> by <?php comment_author_link(); ?> on <?php comment_date(); ?> at <?php comment_time(); ?></cite>
- </li>
- <?php endforeach; ?>
- </ol>
- <?php else : ?>
- <p>No comments yet</p>
- <?php endif; ?>
- /*==================================================================
- The Comment Form
- ===================================================================*/
- // WordPress default comment form
- <?php comment_form(); ?>
- //WordPress custom comment form
- <h3><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h3>
- <?php if(comments_open()) : ?>
- <?php if(get_option('comment_registration') && !$user_ID) : ?>
- <p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>
- <?php else : ?>
- <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
- <?php if($user_ID) : ?>
- <p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Log out »</a></p>
- <?php else : ?>
- <label for="author">
- <small>Name <?php if($req) echo "(required)"; ?></small>
- </label>
- <input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
- <label for="email">
- <small>Mail (will not be published) <?php if($req) echo "(required)"; ?></small>
- </label>
- <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
- <label for="url">
- <small>Website</small>
- </label>
- <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
- <?php endif; ?>
- <textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea>
- <p>Allowed tags: <?php echo allowed_tags(); ?></p>
- <input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
- <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
- <?php do_action('comment_form', $post->ID); ?>
- </form>
- <?php endif; ?>
- <?php else : ?>
- <p>The comments are closed.</p>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement