<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Challenge: how to display only authors who have written in a specific category?</title>
	<atom:link href="http://wpgarage.com/shorties/authors-in-categories/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpgarage.com/shorties/authors-in-categories/</link>
	<description>wordpress tricks, hacks, and tips</description>
	<lastBuildDate>Thu, 26 Jan 2012 06:40:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Tara</title>
		<link>http://wpgarage.com/shorties/authors-in-categories/#comment-62727</link>
		<dc:creator>Tara</dc:creator>
		<pubDate>Sun, 21 Aug 2011 01:33:20 +0000</pubDate>
		<guid isPermaLink="false">http://wordpressgarage.com/shorties/authors-in-categories/#comment-62727</guid>
		<description>Does anyone know how to make a list of categories with a sub menu of authors who have posted in each category so:
 
&lt;strong&gt;category 1&lt;/strong&gt;
-author who has posted in category 1
-author who has posted in category 1
 
&lt;strong&gt;category 2&lt;/strong&gt;
-author who has posted in category 2
-author who has posted in category 2
 
&lt;strong&gt;ETC&lt;/strong&gt; </description>
		<content:encoded><![CDATA[<p>Does anyone know how to make a list of categories with a sub menu of authors who have posted in each category so:<br />
 <br />
<strong>category 1</strong><br />
-author who has posted in category 1<br />
-author who has posted in category 1<br />
 <br />
<strong>category 2</strong><br />
-author who has posted in category 2<br />
-author who has posted in category 2<br />
 <br />
<strong>ETC</strong></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tara</title>
		<link>http://wpgarage.com/shorties/authors-in-categories/#comment-62725</link>
		<dc:creator>Tara</dc:creator>
		<pubDate>Thu, 18 Aug 2011 14:26:02 +0000</pubDate>
		<guid isPermaLink="false">http://wordpressgarage.com/shorties/authors-in-categories/#comment-62725</guid>
		<description>this is great however does anyone know how to make a list of categories then under each category a sub-menu of users who have posted in that category 

for example:


category 1
-user with posts in category 1
-user with posts in category 1
category 2
-user with posts in category 2
-user with posts in category 2
-user with posts in category 2
etc.. 
 </description>
		<content:encoded><![CDATA[<p>this is great however does anyone know how to make a list of categories then under each category a sub-menu of users who have posted in that category </p>
<p>for example:</p>
<p>category 1<br />
-user with posts in category 1<br />
-user with posts in category 1<br />
category 2<br />
-user with posts in category 2<br />
-user with posts in category 2<br />
-user with posts in category 2<br />
etc.. <br />
 </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dvbii</title>
		<link>http://wpgarage.com/shorties/authors-in-categories/#comment-61822</link>
		<dc:creator>dvbii</dc:creator>
		<pubDate>Tue, 07 Dec 2010 16:22:33 +0000</pubDate>
		<guid isPermaLink="false">http://wordpressgarage.com/shorties/authors-in-categories/#comment-61822</guid>
		<description>I know this is a long time after this was posted, however, when googling the problem, I found this, so I thought i would share an update to what we have working..based on the last post, this code was placed in the sidebar.php and only shows on the category pages listing all authors with posts in the current category.

&lt;?php if (is_category()) {?&gt;
&lt;?php
$current_category = single_cat_title(&quot;&quot;, false);
$author_array = array();
$args = array(
 &#039;numberposts&#039; =&gt; -1,
 &#039;category_name&#039; =&gt; $current_category,
 &#039;orderby&#039; =&gt; &#039;author&#039;,
 &#039;order&#039; =&gt; &#039;ASC&#039;
 );
$cat_posts = get_posts($args);
foreach ($cat_posts as $cat_post) :
if (!in_array($cat_post-&gt;post_author,$author_array)) {
$author_array[] = $cat_post-&gt;post_author;
}
endforeach;
foreach ($author_array as $author) :
$auth = get_userdata($author)-&gt;display_name;
$auth_link = get_userdata($author)-&gt;user_login;
echo &quot;&lt;a href=&#039;/author/&quot;;
echo $auth_link;
echo &quot;&#039;&gt;&quot;;
echo $auth;
echo &quot;&lt;/a&gt;&quot;;
echo &quot;&lt;br /&gt;&quot;;
endforeach;
?&gt;
&lt;?php }?&gt;
</description>
		<content:encoded><![CDATA[<p>I know this is a long time after this was posted, however, when googling the problem, I found this, so I thought i would share an update to what we have working..based on the last post, this code was placed in the sidebar.php and only shows on the category pages listing all authors with posts in the current category.</p>
<p>&lt;?php if (is_category()) {?&gt;<br />
&lt;?php<br />
$current_category = single_cat_title(&#8220;&#8221;, false);<br />
$author_array = array();<br />
$args = array(<br />
 &#8216;numberposts&#8217; =&gt; -1,<br />
 &#8216;category_name&#8217; =&gt; $current_category,<br />
 &#8216;orderby&#8217; =&gt; &#8216;author&#8217;,<br />
 &#8216;order&#8217; =&gt; &#8216;ASC&#8217;<br />
 );<br />
$cat_posts = get_posts($args);<br />
foreach ($cat_posts as $cat_post) :<br />
if (!in_array($cat_post-&gt;post_author,$author_array)) {<br />
$author_array[] = $cat_post-&gt;post_author;<br />
}<br />
endforeach;<br />
foreach ($author_array as $author) :<br />
$auth = get_userdata($author)-&gt;display_name;<br />
$auth_link = get_userdata($author)-&gt;user_login;<br />
echo &#8220;&lt;a href=&#8217;/author/&#8221;;<br />
echo $auth_link;<br />
echo &#8220;&#8216;&gt;&#8221;;<br />
echo $auth;<br />
echo &#8220;&lt;/a&gt;&#8221;;<br />
echo &#8220;&lt;br /&gt;&#8221;;<br />
endforeach;<br />
?&gt;<br />
&lt;?php }?&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ales</title>
		<link>http://wpgarage.com/shorties/authors-in-categories/#comment-60076</link>
		<dc:creator>Ales</dc:creator>
		<pubDate>Tue, 23 Jun 2009 09:50:36 +0000</pubDate>
		<guid isPermaLink="false">http://wordpressgarage.com/shorties/authors-in-categories/#comment-60076</guid>
		<description>This might be useful to someone.
I&#039;ve taken the code above and turned it into this...
This works for me and does exactly what is described above...
&lt;?php 
 $author_array = array();
 $cat_posts = get_posts(&#039;numberposts=-1&amp;category=48&amp;orderby=author&amp;order=ASC&#039;);

 foreach ($cat_posts as $cat_post) :
 if (!in_array($cat_post-&gt;post_author,$author_array)) { 
 $author_array[] = $cat_post-&gt;post_author;
 }
 endforeach; 
 
 foreach ($author_array as $author) :
 $auth = get_userdata($author)-&gt;display_name;
 $auth_link = get_userdata($author)-&gt;user_login;
 echo &#039;&lt;a href=&quot;/author/&#039;.$auth_link.&#039;&quot;&gt;&#039;;
 echo $auth;
 echo &#039;&lt;/a&gt;&#039;;
 echo &#039;&lt;br /&gt;&#039;;
 
 endforeach; 
 ?&gt;</description>
		<content:encoded><![CDATA[<p>This might be useful to someone.<br />
I&#8217;ve taken the code above and turned it into this&#8230;<br />
This works for me and does exactly what is described above&#8230;<br />
&lt;?php<br />
 $author_array = array();<br />
 $cat_posts = get_posts(&#8216;numberposts=-1&amp;category=48&amp;orderby=author&amp;order=ASC&#8217;);</p>
<p> foreach ($cat_posts as $cat_post) :<br />
 if (!in_array($cat_post-&gt;post_author,$author_array)) {<br />
 $author_array[] = $cat_post-&gt;post_author;<br />
 }<br />
 endforeach; </p>
<p> foreach ($author_array as $author) :<br />
 $auth = get_userdata($author)-&gt;display_name;<br />
 $auth_link = get_userdata($author)-&gt;user_login;<br />
 echo &#8216;&lt;a href=&#8221;/author/&#8217;.$auth_link.&#8217;&#8221;&gt;&#8217;;<br />
 echo $auth;<br />
 echo &#8216;&lt;/a&gt;&#8217;;<br />
 echo &#8216;&lt;br /&gt;&#8217;;</p>
<p> endforeach;<br />
 ?&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Interesting websites for SEO, Web Marketing and everday work from Sante &#62; &#62; October 21st - November 28th</title>
		<link>http://wpgarage.com/shorties/authors-in-categories/#comment-23904</link>
		<dc:creator>Interesting websites for SEO, Web Marketing and everday work from Sante &#62; &#62; October 21st - November 28th</dc:creator>
		<pubDate>Mon, 01 Dec 2008 12:39:47 +0000</pubDate>
		<guid isPermaLink="false">http://wordpressgarage.com/shorties/authors-in-categories/#comment-23904</guid>
		<description>[...]  Challenge: how to display only authors who have written in a specific category? &#124; Wordpress Garage &lt; br/&gt; automatically display on a category page only the authors who have written articles in that particular category on your WordPress Blog [...]</description>
		<content:encoded><![CDATA[<p>[...]  Challenge: how to display only authors who have written in a specific category? | WordPress Garage &lt; br/&gt; automatically display on a category page only the authors who have written articles in that particular category on your WordPress Blog [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charly Silaban</title>
		<link>http://wpgarage.com/shorties/authors-in-categories/#comment-1180</link>
		<dc:creator>Charly Silaban</dc:creator>
		<pubDate>Thu, 24 Apr 2008 05:16:21 +0000</pubDate>
		<guid isPermaLink="false">http://wordpressgarage.com/shorties/authors-in-categories/#comment-1180</guid>
		<description>I have the same problem here &lt;a href=&quot;http://wordpress.org/support/topic/169195&quot; rel=&quot;nofollow&quot;&gt;http://wordpress.org/support/topic/169195&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>I have the same problem here <a href="http://wordpress.org/support/topic/169195" rel="nofollow">http://wordpress.org/support/topic/169195</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rebecca</title>
		<link>http://wpgarage.com/shorties/authors-in-categories/#comment-1178</link>
		<dc:creator>Rebecca</dc:creator>
		<pubDate>Sun, 30 Mar 2008 10:25:37 +0000</pubDate>
		<guid isPermaLink="false">http://wordpressgarage.com/shorties/authors-in-categories/#comment-1178</guid>
		<description>Hi Mark - I tried implementing the code but I think it stopped displaying authors after the first author. any ideas? Did you get it to work for you on your own site? Thanks so much</description>
		<content:encoded><![CDATA[<p>Hi Mark &#8211; I tried implementing the code but I think it stopped displaying authors after the first author. any ideas? Did you get it to work for you on your own site? Thanks so much</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://wpgarage.com/shorties/authors-in-categories/#comment-1179</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Fri, 28 Mar 2008 04:12:11 +0000</pubDate>
		<guid isPermaLink="false">http://wordpressgarage.com/shorties/authors-in-categories/#comment-1179</guid>
		<description>argh!  lol i must be tired

instead of echo $a, use:

the_author_posts_link ();</description>
		<content:encoded><![CDATA[<p>argh!  lol i must be tired</p>
<p>instead of echo $a, use:</p>
<p>the_author_posts_link ();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://wpgarage.com/shorties/authors-in-categories/#comment-1175</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Fri, 28 Mar 2008 04:11:16 +0000</pubDate>
		<guid isPermaLink="false">http://wordpressgarage.com/shorties/authors-in-categories/#comment-1175</guid>
		<description>Sorry,

i have the arguments backwards for strstr:

if(!strstr($authors,$a))
{
echo $a;
$authors.=$a;
}</description>
		<content:encoded><![CDATA[<p>Sorry,</p>
<p>i have the arguments backwards for strstr:</p>
<p>if(!strstr($authors,$a))<br />
{<br />
echo $a;<br />
$authors.=$a;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://wpgarage.com/shorties/authors-in-categories/#comment-1174</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Fri, 28 Mar 2008 04:10:08 +0000</pubDate>
		<guid isPermaLink="false">http://wordpressgarage.com/shorties/authors-in-categories/#comment-1174</guid>
		<description>This will do it for you:


&lt;?php while (have_posts()) : the_post();
global $authordata;
$a=get_author_posts_url ($authordata);
if(!strstr($a,$authors))
{
    echo $a;
    $authors.=$a;
}</description>
		<content:encoded><![CDATA[<p>This will do it for you:</p>
<p>&lt;?php while (have_posts()) : the_post();<br />
global $authordata;<br />
$a=get_author_posts_url ($authordata);<br />
if(!strstr($a,$authors))<br />
{<br />
    echo $a;<br />
    $authors.=$a;<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>

