• owlservice

    (@owlservice)


    Hi there,

    I want to list my authors using the above tag but is there a way to hide authors yet to post?

    Thanks a lot

Viewing 4 replies - 1 through 4 (of 4 total)
  • Kafkaesqui

    (@kafkaesqui)

    http://codex.wordpress.org/Template_Tags/wp_list_authors

    See the info on the ‘hide_empty’ parameter.

    Thread Starter owlservice

    (@owlservice)

    Many thanks for that. I have implemented it but for some reason it shows posts that have been deleted as well on the count. So if a post has been deleted it still shows the author as well.

    Any ideas?

    Thanks

    Thread Starter owlservice

    (@owlservice)

    Ah actually I have found out why now. Draft documaents. Can they be hidden from the tag with some syntax?

    Thanks

    Kafkaesqui

    (@kafkaesqui)

    This was actually reported as a bug, and will be fixed in 1.5.1.

    http://mosquito.wordpress.org/view.php?id=1010

    In the mean time you can *repair* it with a one line modification to the source. Open wp-includes/functions.php in a text editor and around line 210 you’ll find the get_usernumposts() function:

    function get_usernumposts($userid)

    A few lines down change the sql query being returned from this:

    return $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = '$userid'");

    to this:

    return $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = '$userid' && post_status = 'publish'");

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘wp_list_authors(); – how do I hide authors yet to contribute?’ is closed to new replies.