Source file: modules/widgets/authors.php
View in GitHubParameters
- $default_excluded_authors
-
(array) Array of user ID’s that will be excluded
Changelog
Since: Jetpack 4.5.0
How to use this hook
Notes
You can use this filter to exclude specific authors from ever appearing in the Authors Widget. In the example below, the author matching ID 5
will be excluded:
/** * Exclude specific authors from ever appearing in the Authors Widget. * * @param array $default_excluded_authors Array of user ID's that will be excluded. */ function jeherve_exclude_authors_widget( $default_excluded_authors ) { $default_excluded_authors[] = 5; return $default_excluded_authors; } add_filter( 'jetpack_widget_authors_exclude', 'jeherve_exclude_authors_widget' );
To find out the ID of each author you’d like to exclude, you can go to the Users menu in your dashboard, and click on an author’s name to edit their profile: their profile editing page URL will include the author ID.
Where do I add this code?
You can follow the instructions here to see how to use the filters you’ll find on this site:
https://developer.jetpack.com/customize-jetpack-actions-filters/
Thanks for your prompt response Jeremy. I checked out the link you sent. I’m afraid I’m in way over my head. I don;t have any developer experience and I’m just looking for a custom CSS to change the style of the Authors widget. You can see the widget title “Latest Features” here: http://pittalkasia.com/author-widget-test/
I want to remove the bullet points beside each article heading, change size and colour of the Author’s names and post titles, and only include specific authors in the list.
I’ve been searching everywhere for help.
You can customize the look of every element on your site thanks to CSS. You can add that CSS to your theme stylesheet, or to your custom CSS editor available under Appearance > Edit CSS in your dashboard.
If you’re not familiar with CSS, don’t hesitate to start a new thread in the Jetpack support forums, explain what you’d like to do there, and I’ll help!
https://wordpress.org/support/plugin/jetpack#new-post
How can I add several authors to filter? Or is there any other way only to list the selected authors?
Ahmet,
You can exclude multiple authors simply by adding more ID’s into the array, like so:
https://pastebin.com/raw/Q8dqUmCc
Thanks!
Thank you very much.
Dear Adam,
I can’t be sure if this is the right place to ask this question but I can’t find any better place.
I need a solution to sort authors. Some specific authors need to be in first and second place but the recent system sorts them all by name. Is there any way to this? Maybe there is a custom filter for sorting authors by ID’s specifying those manually?
Thanks
That’s not currently possible, but I took note of your suggestion here:
https://github.com/Automattic/jetpack/issues/13141