Use specific language for comment section

On the bottom of comments.php I use the following code: <?php comment_form(array(‘comment_field’ => ‘<p class=”comment-form-comment”><label for=”comment”>Comment</label><textarea id=”comment” name=”comment” cols=”45″ rows=”8″ aria-required=”true”></textarea></p>’, ‘comment_notes_before’ => ‘<p class=”comment-notes”>Your email address will not be published. Required fields are marked *</p>’, ‘comment_notes_after’ => ”, ‘title_reply’ => ‘Leave a Reply’, ‘title_reply_to’ => ‘Leave a Reply to %s’, ‘label_submit’ => ‘Post comment’, … Read more

same comment list for two posts

You could use get_comments() instead. The code in this forum post gives an example of how you’d do that: <?php $recent_comments = get_comments( array(‘post_id’ => $newest_post_id,) ); foreach ($recent_comments as $comment) { ?> <?php $comment_id = get_comment($comment->comment_ID); $author = $comment_id->comment_author; $commentdate = $comment_id->comment_date; $content = $comment_id->comment_content; ?> <p><?php echo $author; echo $commentdate;?></p> <p><?php echo $content;?></p> … Read more

Comment Function

the function you posted is limited to 5 comments which means it should work, but anyway there is no need for a custom SQL query when you can use the native get_comments function function showLatestComments() { $comments = get_comments(array( ‘status’ => ‘approve’, ‘number’ => ‘5’ ) ); $output .= ‘<h2>Latest student perspectives <img src=”https://wordpress.stackexchange.com/wp-content/themes/blue-and-grey/images/hmepage-tri.png” class=”class3″ … Read more

How do I separate author avatars and comments in 3.4.2?

Ok, so this is what I’ve done. If anybody has a better idea I will leave the answer open for a few hours and choose it! <?php if($comments) : ?> <ol> <?php foreach($comments as $comment) : ?> <li id=”comment-<?php comment_ID(); ?>”> <?php if ($comment->comment_approved == ‘0’) : ?> <p>Your comment is awaiting approval</p> <?php endif; … Read more

Actual comments not showing, but form is?

Your format looks a bit off to me. I’d try it more like this: <?php $fields = array( ‘author’ => ‘<p><label for=”author”><span class=”req”>* </span>’ . __( ‘Name’ ) . ‘</label><input id=”author” name=”author” type=”text” value=”‘ . esc_attr( $commenter[‘comment_author’] ) . ‘” size=”30″‘ . $aria_req . ‘ /></p>’, ’email’ => ‘<p><label for=”email”><span class=”req”>* </span>’ . __( ‘Email’ … Read more

2 tick boxes appearing below comments

Those are “subscribe” checkboxes. View source and you can see them and the rest of the content. <p class=”comment-subscription-form”> <input type=”checkbox” name=”subscribe_comments” id=”subscribe_comments” value=”subscribe” style=”width: auto; -moz-appearance: checkbox; -webkit-appearance: checkbox;” /> <label class=”subscribe-label” id=”subscribe-label” for=”subscribe_comments”>Notify me of follow-up comments by email.</label></p> <p class=”comment-subscription-form”> <input type=”checkbox” name=”subscribe_blog” id=”subscribe_blog” value=”subscribe” style=”width: auto; -moz-appearance: checkbox; -webkit-appearance: checkbox;” /> … Read more

By Default, Turn Comments Off for Pages & Leave Comments On for Posts

Hook into wp_insert_post, check if it is an auto-draft for a page, and set the comment_status to closed: add_action( ‘wp_insert_post’, ‘t5_disable_default_comments_on_pages’, 10, 2 ); function t5_disable_default_comments_on_pages( $post_ID, $post ) { remove_filter( current_filter(), __FUNCTION__ ); if ( ‘auto-draft’ !== $post->post_status or ‘page’ !== $post->post_type ) return; $post->comment_status=”closed”; wp_update_post( $post ); }