Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter flapane

    (@flapane)

    Code copied from the older (and closed) thread

    if ( !$comments = wp_cache_get( 'recent_comments', 'widget' ) ) {
    	$comments = $wpdb->get_results("SELECT $wpdb->comments.* FROM $wpdb->comments JOIN $wpdb->posts ON $wpdb->posts.ID = $wpdb->comments.comment_post_ID WHERE comment_approved = '1' AND post_status = 'publish' AND comment_type IN ('comment', '') ORDER BY comment_date_gmt DESC LIMIT 15");
    	wp_cache_add( 'recent_comments', $comments, 'widget' );
    }

    Thread Starter flapane

    (@flapane)

    bump

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Exclude Trackbacks and Pingbacks from Defualt WordPress Recent Comments’ is closed to new replies.