I want to have the authors listed like usual from wp_list_authors()
but I know there are a couple of ones I would like to exclude from the list as well. Is there a way to do that?
Thanks
I want to have the authors listed like usual from wp_list_authors()
but I know there are a couple of ones I would like to exclude from the list as well. Is there a way to do that?
Thanks
You must be logged in to post a comment.
wp_list_authors()
now does have anexclude
parameter. So you can exclude the authors you want by their user ID.It accepts:
Examples:
It seems
wp_list_authors
does not have any filters, nor doesget_users_of_blog
, the function it uses to get the user list. So you either have to regex-and-replace the output yourself, or create a similar function with an extra parameter to specify authors to exclude. It’s not too big, and most of the code is spent handling options, so it isn’t that much duplication.You could always vote for the existing Trac ticket to get an
exclude
parameter added in a future version!I have used the following code to include info from Authors (WordPress users) in a page template. It could be reversed to exclude authors.
Since it seems there is no way to do this without a custom function, you could use jQuery to find their names and hide them after the list is generated. Something like this:
I also found a plugin that can do this for you:
List Authors Plus