Edit Comments Form in TwentyEleven

The comments template is added to template files via the comments_template() template tag. The comments_template() template tag includes the comments.php template-part file. The comments.php template-part file includes the comment-reply form via the comment_form() template tag. Refer to the Codex (linked) for detailed instructions for modifying the content and output of comment_form().

How to get last comments but not from admin (or other specific user role/capability)?

Yay! We got filters! Wrapping the result of the $wpdb comments query right into a filter callback (and a plugin) is the nice way of handling comments. /* Plugin Name: »Kaisers« Comments without admin comments */ ! defined( ‘ABSPATH’ ) AND exit; add_filter( ‘comments_array’, ‘wpse_61072_comments_without_admin’, 20, 2 ); function wpse_61072_comments_without_admin( $comments, $post_id ) { foreach … Read more

Get number of comments per page

From quick look at core that would probably be get_option(‘comments_per_page’). However WP functions just use this internally, why not just let them take care of it? You are not describing why do you need to handle this directly.

How to no follow the paginated comments

There are two special filters for that: add_filter( ‘previous_comments_link_attributes’, ‘wpse_77217_comment_nofollow’ ); add_filter( ‘next_comments_link_attributes’, ‘wpse_77217_comment_nofollow’ ); function wpse_77217_comment_nofollow() { return ‘ rel=”nofollow”‘; }

adding a text message beside the comment submit button

You should not edit the WordPress core files! If you have comment_id_fields() in your comments template, like this: <p class=”form-submit”> <input name=”submit” type=”submit” id=”<?php echo esc_attr( $args[‘id_submit’] ); ?>” value=”<?php echo esc_attr( $args[‘label_submit’] ); ?>” /> <?php comment_id_fields( $post_id ); ?> </p> you might use: add_filter(“comment_id_fields”,”my_submit_comment_message”); function my_submit_comment_message($result){ return $result.” <span>(your message will only be … Read more

Adding custom column to comments admin panel?

The filter you’re looking for is manage_edit-comments_columns. Here is a post detailing how to add custom columns to the edit comments section of the admin http://stv.whtly.com/2011/07/27/adding-custom-columns-to-the-wordpress-comments-admin-page/

How stop the process of submitting a comment if a field is empty?

If you use wp-comments-post.php it would be better to customize comment_form by hook comment_form_default_fields, I don’t know why you create the new one. But as per of your functions you can handle it like this add_filter( ‘preprocess_comment’, ‘verify_comment_meta_data’, 1, 1 ); function verify_comment_meta_data( $commentdata ) { $commentdata[‘review_title’] = ( ! empty ( $_POST[‘review_title’] ) ) … Read more

How to check if comments are paginated?

Just some additional info for the main comment query: Since you mentioned the global $wp_query object, we can see that it stores: $wp_query->max_num_comment_pages = $comment_query->max_num_pages; in the main comment query in the comments template. There exists a wrapper for this, namely: get_comment_pages_count(); that’s available after the main comment query. If we need it before the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)