User’s total comment count excluding comments on their own posts

I’m not aware of any WordPress functions that do this, so you can try to play with this kind of query (untested): function get_custom_user_comments_count( $uid ){ global $wpdb; $sql = “SELECT COUNT(*) as total  FROM {$wpdb->comments} as c   JOIN {$wpdb->posts} as p ON p.ID = c.comment_post_ID  WHERE c.comment_approved = ‘1’  AND p.post_status=”publish”   AND … Read more

Modify text after post count

The _n() function will sort out single from plural. How to use it is in the codex. EDIT: Apologies. My first go at an answer wasn’t quite enough to get you there. The trouble with using wp_list_categories() in this context is that it prints out pre-formatted HTML and you don’t end up with any value … Read more

Display Published Posts Count for Certain Time Period

You can fetch the record using bellow query $posts= get_posts(array( ‘numberposts’ => -1, ‘post_status’ => ‘publish’, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, ‘date_query’ => array( ‘column’ => ‘post_date’, ‘after’ => ‘-7 days’ // -7 Means last 7 days ) )); echo count($posts); If you want to get last 6 month the use -6 Months

Counter of posts ever posted – even deleted ones

Depending on your needs, WP Query may not work for this since it won’t include posts that have been deleted after the trash has been emptied. This should work (but hasn’t been tested): function wpse_custom_post_type_counter() { $number = get_option( ‘wpse_custom_counter’ ) ? absint( get_option( ‘wpse_custom_counter’ ) ): 0; $number++; update_option( ‘wpse_custom_counter’, $number ); } add_action( … Read more

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