Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Forum: Plugins
    In reply to: Akismet hates Rosalind

    Same here. Funny thing is, even one of my writers, when logged in, got tagged as spam…

    Hi there

    Try to change this function in functions.php (in the include-directory):

    function get_usernumposts($userid) {
    global $wpdb;
    return $wpdb->get_var(“SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = ‘$userid'”);
    }

    to something like this: (this will count the number of published posts)

    function get_usernumposts($userid) {
    global $wpdb;
    return $wpdb->get_var(“SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = ‘$userid’ AND post_status = ‘publish'”);
    }

    or (to just count each non-draft post):

    function get_usernumposts($userid) {
    global $wpdb;
    return $wpdb->get_var(“SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = ‘$userid’ AND post_status <> ‘draft'”);
    }

Viewing 2 replies - 1 through 2 (of 2 total)