WordPress.org

Ready to get started?Download WordPress

Forums

Exclude Trackbacks and Pingbacks from Defualt WordPress Recent Comments (3 posts)

  1. flapane
    Member
    Posted 3 years ago #

    Hi,
    I copied the code from http://wordpress.org/support/topic/plugin-recentcomments-exclude-trackbacks-and-pingbacks-from-defualt-wordpress-recent-comments-widget?replies=7 and pasted it into my functions.php.

    However, I still can see the trackbacks, as shown here (diggita.it):
    http://i.imgur.com/oXWX4.jpg

  2. flapane
    Member
    Posted 3 years ago #

    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' );
    }
  3. flapane
    Member
    Posted 3 years ago #

    bump

Topic Closed

This topic has been closed to new replies.

About this Topic