{"id":318,"date":"2011-07-26T16:38:32","date_gmt":"2011-07-26T16:38:32","guid":{"rendered":"http:\/\/www.sitekickr.com\/blog\/?p=318"},"modified":"2011-07-26T16:38:32","modified_gmt":"2011-07-26T16:38:32","slug":"wordpress-list-authors-plugin-exclude-admins","status":"publish","type":"post","link":"https:\/\/www.sitekickr.com\/blog\/wordpress-list-authors-plugin-exclude-admins\/","title":{"rendered":"WordPress &#8211; List Authors plugin &#8211; exclude admins"},"content":{"rendered":"<p>If you&#39;ve had the need to list all authors\/contributors on your WordPress site in a sidebar widget, you may have come across the simple, yet effective List Author&#39;s plugin.<\/p>\n<p>The plugin is great, except for the &quot;Exclude Admins&quot; feature, which actually only excludes users with the username of &quot;admin&quot;.<\/p>\n<p>If you open up list-authors.php and change the following sections, you&#39;ll be in business:<\/p>\n<p><code>} else {<br \/>\n\t&nbsp;&nbsp;&nbsp; $author_posts_join = &#39;&#39;;<br \/>\n\t&nbsp;&nbsp;&nbsp; $author_where = &#39;&#39;;<br \/>\n\t&nbsp;&nbsp;&nbsp; $author_group_by = &quot;GROUP BY $wpdb-&gt;users.ID&quot;;<br \/>\n\t}<br \/>\n\t<\/code><\/p>\n<hr \/>\n<p><code>\/\/ Query the list of users<br \/>\n\t$sql = &quot;<br \/>\n\t&nbsp;&nbsp;&nbsp; SELECT $author_select<br \/>\n\t&nbsp;&nbsp;&nbsp; FROM $wpdb-&gt;users<br \/>\n\t&nbsp;&nbsp;&nbsp; INNER JOIN wp_usermeta<br \/>\n\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ON wp_usermeta.user_id = wp_users.ID<br \/>\n\t&nbsp;&nbsp;&nbsp; $author_posts_join<br \/>\n\t&nbsp;&nbsp;&nbsp; $author_name_join<br \/>\n\t&nbsp;&nbsp;&nbsp; $author_cap_join<br \/>\n\t&nbsp;&nbsp;&nbsp; $author_where<br \/>\n\t&nbsp;&nbsp;&nbsp; AND (wp_usermeta.meta_key = &#39;wp_user_level&#39; AND wp_usermeta.meta_value &lt; 10)<br \/>\n\t&nbsp;&nbsp;&nbsp; $author_group_by<br \/>\n\t&nbsp;&nbsp;&nbsp; $author_having<br \/>\n\t&nbsp;&nbsp;&nbsp; $author_sort<br \/>\n\t&nbsp;&nbsp;&nbsp; $author_limit<br \/>\n\t&nbsp;&nbsp;&nbsp; &quot;;<br \/>\n\t<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#39;ve had the need to list all authors\/contributors on your WordPress site in a sidebar widget, you may have come across the simple, yet&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"amp_status":""},"categories":[103],"tags":[292],"_links":{"self":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/318"}],"collection":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/comments?post=318"}],"version-history":[{"count":0,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/318\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media?parent=318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/categories?post=318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/tags?post=318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}