WP_Comment_Query with 5 top level comments per page?

Updated The hierarchical parameter controls whether to include comment descendants in the comments results. From the inline docs we have that it accepts the following values: ‘threaded’ returns a tree, with each comment’s children stored in a children property on the WP_Comment object. ‘flat’ returns a flat array of found comments plus their children. false … Read more

How to save new comment as custom comment type?

In addition. You already have code which can kind of do what you need. add_filter( ‘preprocess_comment’, ‘verify_comment_meta_data’ ); function verify_comment_meta_data( $commentdata ) { if ( ! isset( $_POST[‘wp_review_comment_rating’] ) ) wp_die( __( ‘A rating is required. Hit the BACK button and resubmit your review with a rating.’ ) ); // this is filter and $commentdata … Read more

Toggle nested comments

http://jsfiddle.net/K3gr7/4/ I used an ordered list to markup the comments. You probably need to tweak it to your own setup, and cache some variables for optimization, but the functionality is in there. $(document).ready(function() { // Toggle all $(‘#toggle-all’).click(function() { var $subcomments = $(‘#comments’).find(‘> li > ol’); if ($subcomments.filter(‘:hidden’).length) { $subcomments.slideDown(); } else { $subcomments.slideUp(); } … Read more

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”‘; }

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