<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>WordPress &#8250; Support Topic: Get Tags specific to  Category</title>
<link>http://wordpress.org/support/</link>
<description>WordPress &#8250; Support Topic: Get Tags specific to  Category</description>
<language>en</language>
<pubDate>Wed, 25 Nov 2009 21:56:41 +0000</pubDate>

<item>
<title>alukeonlife on "Get Tags specific to  Category"</title>
<link>http://wordpress.org/support/topic/276635#post-1289394</link>
<pubDate>Sat, 21 Nov 2009 19:26:14 +0000</pubDate>
<dc:creator>alukeonlife</dc:creator>
<guid isPermaLink="false">1289394@http://wordpress.org/support/</guid>
<description>&#60;p&#62;I follow the logic above, but I'd love a bit of help on implementation:&#60;/p&#62;
&#60;p&#62;If I add the &#34;function get_category_tags&#34; code above to my functions.php is there a way I can modify the tag cloud widget to display the current category if i'm on a category page or all if not?&#60;/p&#62;
&#60;p&#62;IE in psuedo-code:&#60;/p&#62;
&#60;p&#62;If (on a category page) then&#60;br /&#62;
   tag cloud called using get_category_tags (with current catID)&#60;br /&#62;
else&#60;br /&#62;
   normal tag cloud code&#60;/p&#62;
&#60;p&#62;The aim is to only show tags relating to products in the current category when on a category page.
&#60;/p&#62;</description>
</item>
<item>
<title>MarjWyatt on "Get Tags specific to  Category"</title>
<link>http://wordpress.org/support/topic/276635#post-1244651</link>
<pubDate>Tue, 13 Oct 2009 05:33:28 +0000</pubDate>
<dc:creator>MarjWyatt</dc:creator>
<guid isPermaLink="false">1244651@http://wordpress.org/support/</guid>
<description>&#60;p&#62;I read this thread with interest.  What I want to do is somewhat hard to explain and is confounded further by the fact that my pal is using  Thesis, which goes about Wordpress in a very different way.  ~sigh~&#60;/p&#62;
&#60;p&#62;Scenario is this:&#60;br /&#62;
1) A company profile post exists in profiles category and company name profile without any tag.&#60;/p&#62;
&#60;p&#62;2)  Regular news updates will be posted to the site that are categorized in a News category and also categorized in the company category.  Using tags that match the company name seemed to be the best way to integrate the content.&#60;/p&#62;
&#60;p&#62;So we have 3 categories involved.  Profile, News, and Company.  When visitors choose the profile content, it is a single post that we want to augment with content from the News Category relating to that Company.&#60;/p&#62;
&#60;p&#62;If you're still reading and understanding, I totally appreciate you!&#60;/p&#62;
&#60;p&#62;I admit that I am not SQL savvy, although I have administered databases in the past.  The problem is ... that was over 15 years ago!  I would qualify my skill level is being &#34;dangerous&#34; but not foolish.&#60;/p&#62;
&#60;p&#62;If worked out the following query which kind of does what I want:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;SELECT post_title, post_date, post_content, name AS cat_name
FROM 	wp_posts p,
	wp_terms t,
	wp_term_relationships r,
	wp_term_taxonomy tt
WHERE	p.post_status=&#38;#39;publish&#38;#39; AND
	tt.taxonomy=&#38;#39;post_tag&#38;#39; AND
	tt.description=t.name AND
	p.id=r.object_id AND
	r.term_taxonomy_id=tt.term_taxonomy_id AND
	tt.term_id=t.term_id;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The problem is this, I can't figure out how to ask &#34;if&#34; before submitting the query and this query returns content that is unrelated to the company because the conditions are met and there is nothing to exclude non-company related News.&#60;/p&#62;
&#60;p&#62;Help me please.  This solution is in the critical path.
&#60;/p&#62;</description>
</item>
<item>
<title>whipd09 on "Get Tags specific to  Category"</title>
<link>http://wordpress.org/support/topic/276635#post-1243361</link>
<pubDate>Mon, 12 Oct 2009 02:30:14 +0000</pubDate>
<dc:creator>whipd09</dc:creator>
<guid isPermaLink="false">1243361@http://wordpress.org/support/</guid>
<description>&#60;p&#62;Hey guys, I'm looking for something VERY similar to this.&#60;/p&#62;
&#60;p&#62;I need the tags at the end of a post (single page) to ONLY link to a tag archive of posts that are also in the SAME parent category as that post.&#60;/p&#62;
&#60;p&#62;Any Ideas?
&#60;/p&#62;</description>
</item>
<item>
<title>t31os_ on "Get Tags specific to  Category"</title>
<link>http://wordpress.org/support/topic/276635#post-1240958</link>
<pubDate>Fri, 09 Oct 2009 16:36:09 +0000</pubDate>
<dc:creator>t31os_</dc:creator>
<guid isPermaLink="false">1240958@http://wordpress.org/support/</guid>
<description>&#60;p&#62;Kelsey the count is already in the count field(column) in the taxonomy table, would it not be quicker to just select that field... here's the query snippet i've been using...&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;$category_tags = $wpdb-&#38;gt;get_results(&#38;quot;
SELECT DISTINCT
	terms2.term_id as tag_ID,
	terms2.name as tag_name,
	t2.count as posts_with_tag
FROM
	$wpdb-&#38;gt;posts as p1
	LEFT JOIN $wpdb-&#38;gt;term_relationships as r1 ON p1.ID = r1.object_ID
	LEFT JOIN $wpdb-&#38;gt;term_taxonomy as t1 ON r1.term_taxonomy_id = t1.term_taxonomy_id
	LEFT JOIN $wpdb-&#38;gt;terms as terms1 ON t1.term_id = terms1.term_id,

	$wpdb-&#38;gt;posts as p2
	LEFT JOIN $wpdb-&#38;gt;term_relationships as r2 ON p2.ID = r2.object_ID
	LEFT JOIN $wpdb-&#38;gt;term_taxonomy as t2 ON r2.term_taxonomy_id = t2.term_taxonomy_id
	LEFT JOIN $wpdb-&#38;gt;terms as terms2 ON t2.term_id = terms2.term_id
WHERE (
	t1.taxonomy = &#38;#39;category&#38;#39; AND
	p1.post_status = &#38;#39;publish&#38;#39; AND
	terms1.term_id = &#38;#39;$varcat&#38;#39; AND
	t2.taxonomy = &#38;#39;post_tag&#38;#39; AND
	p2.post_status = &#38;#39;publish&#38;#39; AND
	p1.ID = p2.ID
	)
&#38;quot;);&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>kelseydamas on "Get Tags specific to  Category"</title>
<link>http://wordpress.org/support/topic/276635#post-1240420</link>
<pubDate>Fri, 09 Oct 2009 06:47:43 +0000</pubDate>
<dc:creator>kelseydamas</dc:creator>
<guid isPermaLink="false">1240420@http://wordpress.org/support/</guid>
<description>&#60;p&#62;Here's the same query as I posted above but it includes an extra column for the number of posts using that tag.  This returns the top 20 tags in a given category.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;SELECT DISTINCT terms2.name as name, terms2.slug as slug, COUNT(terms2.slug) as numposts
                FROM
                    wp_posts as p1
                    LEFT JOIN wp_term_relationships as r1 ON p1.ID = r1.object_ID
                    LEFT JOIN wp_term_taxonomy as t1 ON r1.term_taxonomy_id = t1.term_taxonomy_id
                    LEFT JOIN wp_terms as terms1 ON t1.term_id = terms1.term_id,

                    wp_posts as p2
                    LEFT JOIN wp_term_relationships as r2 ON p2.ID = r2.object_ID
                    LEFT JOIN wp_term_taxonomy as t2 ON r2.term_taxonomy_id = t2.term_taxonomy_id
                    LEFT JOIN wp_terms as terms2 ON t2.term_id = terms2.term_id
                WHERE
                    t1.taxonomy = &#38;#39;category&#38;#39; AND p1.post_status = &#38;#39;publish&#38;#39; AND terms1.name = &#38;#39;$categoryName&#38;#39; AND
                    t2.taxonomy = &#38;#39;post_tag&#38;#39; AND p2.post_status = &#38;#39;publish&#38;#39;
                    AND p1.ID = p2.ID
                GROUP BY terms2.slug
                ORDER BY numposts DESC
                LIMIT 20&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>MichaelH on "Get Tags specific to  Category"</title>
<link>http://wordpress.org/support/topic/276635#post-1238549</link>
<pubDate>Wed, 07 Oct 2009 18:10:06 +0000</pubDate>
<dc:creator>MichaelH</dc:creator>
<guid isPermaLink="false">1238549@http://wordpress.org/support/</guid>
<description>&#60;p&#62;Just adding a link to this plugin as it can handle tag/category 'intersections':&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://wordpress.org/extend/plugins/tdo-tag-fixes/&#34; rel=&#34;nofollow&#34;&#62;http://wordpress.org/extend/plugins/tdo-tag-fixes/&#60;/a&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>john.andrews on "Get Tags specific to  Category"</title>
<link>http://wordpress.org/support/topic/276635#post-1238530</link>
<pubDate>Wed, 07 Oct 2009 17:56:44 +0000</pubDate>
<dc:creator>john.andrews</dc:creator>
<guid isPermaLink="false">1238530@http://wordpress.org/support/</guid>
<description>&#60;p&#62;Great code input everyone, it's exactly what I needed for a WP I'm working on. I took it a bit further, perhaps someone who hasn't implemented will find this useful.&#60;/p&#62;
&#60;p&#62;In your theme's functions.php insert the following function:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function get_category_tags($args) {
	global $wpdb;
	$tags = $wpdb-&#38;gt;get_results
	(&#38;quot;
		SELECT DISTINCT terms2.term_id as tag_id, terms2.name as tag_name, null as tag_link
		FROM
			wp_posts as p1
			LEFT JOIN wp_term_relationships as r1 ON p1.ID = r1.object_ID
			LEFT JOIN wp_term_taxonomy as t1 ON r1.term_taxonomy_id = t1.term_taxonomy_id
			LEFT JOIN wp_terms as terms1 ON t1.term_id = terms1.term_id,

			wp_posts as p2
			LEFT JOIN wp_term_relationships as r2 ON p2.ID = r2.object_ID
			LEFT JOIN wp_term_taxonomy as t2 ON r2.term_taxonomy_id = t2.term_taxonomy_id
			LEFT JOIN wp_terms as terms2 ON t2.term_id = terms2.term_id
		WHERE
			t1.taxonomy = &#38;#39;category&#38;#39; AND p1.post_status = &#38;#39;publish&#38;#39; AND terms1.term_id IN (&#38;quot;.$args[&#38;#39;categories&#38;#39;].&#38;quot;) AND
			t2.taxonomy = &#38;#39;post_tag&#38;#39; AND p2.post_status = &#38;#39;publish&#38;#39;
			AND p1.ID = p2.ID
		ORDER by tag_name
	&#38;quot;);
	$count = 0;
	foreach ($tags as $tag) {
		$tags[$count]-&#38;gt;tag_link = get_tag_link($tag-&#38;gt;tag_id);
		$count++;
	}
	return $tags;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;In your theme document call the function as follows. Notice it accepts multiple category id's:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$args = array(
	&#38;#39;categories&#38;#39;				=&#38;gt; &#38;#39;12,13,14&#38;#39;
);
$tags = get_category_tags($args);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;This will return an array that you could do the following with:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$content .= &#38;quot;&#38;lt;ul&#38;gt;&#38;quot;;
foreach ($tags as $tag) {
	$content .= &#38;quot;&#38;lt;li&#38;gt;&#38;lt;a href=\&#38;quot;$tag-&#38;gt;tag_link\&#38;quot;&#38;gt;$tag-&#38;gt;tag_name&#38;lt;/a&#38;gt;&#38;lt;/li&#38;gt;&#38;quot;;
}
$content .= &#38;quot;&#38;lt;/ul&#38;gt;&#38;quot;;
echo $content;&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>toplink on "Get Tags specific to  Category"</title>
<link>http://wordpress.org/support/topic/276635#post-1205056</link>
<pubDate>Wed, 09 Sep 2009 12:31:45 +0000</pubDate>
<dc:creator>toplink</dc:creator>
<guid isPermaLink="false">1205056@http://wordpress.org/support/</guid>
<description>&#60;p&#62;excellent work kelseydamas&#60;br /&#62;
thank you for it
&#60;/p&#62;</description>
</item>
<item>
<title>t31os_ on "Get Tags specific to  Category"</title>
<link>http://wordpress.org/support/topic/276635#post-1204691</link>
<pubDate>Wed, 09 Sep 2009 01:46:42 +0000</pubDate>
<dc:creator>t31os_</dc:creator>
<guid isPermaLink="false">1204691@http://wordpress.org/support/</guid>
<description>&#60;p&#62;Perfect example, thank you kelsey...&#60;/p&#62;
&#60;p&#62;Clearly someone who knows their joins.. ;) Worked flawlessly first time..
&#60;/p&#62;</description>
</item>
<item>
<title>kelseydamas on "Get Tags specific to  Category"</title>
<link>http://wordpress.org/support/topic/276635#post-1204630</link>
<pubDate>Wed, 09 Sep 2009 00:07:02 +0000</pubDate>
<dc:creator>kelseydamas</dc:creator>
<guid isPermaLink="false">1204630@http://wordpress.org/support/</guid>
<description>&#60;p&#62;This query seemed to work for me.  In this case 'Lectures' is the name of the category and the column 'tag' will have all the tags in this category&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;SELECT DISTINCT terms2.name as tag
FROM
	wp_posts as p1
	LEFT JOIN wp_term_relationships as r1 ON p1.ID = r1.object_ID
	LEFT JOIN wp_term_taxonomy as t1 ON r1.term_taxonomy_id = t1.term_taxonomy_id
	LEFT JOIN wp_terms as terms1 ON t1.term_id = terms1.term_id,

	wp_posts as p2
	LEFT JOIN wp_term_relationships as r2 ON p2.ID = r2.object_ID
	LEFT JOIN wp_term_taxonomy as t2 ON r2.term_taxonomy_id = t2.term_taxonomy_id
	LEFT JOIN wp_terms as terms2 ON t2.term_id = terms2.term_id
WHERE
	t1.taxonomy = &#38;#39;category&#38;#39; AND p1.post_status = &#38;#39;publish&#38;#39; AND terms1.name = &#38;#39;Lectures&#38;#39; AND
	t2.taxonomy = &#38;#39;post_tag&#38;#39; AND p2.post_status = &#38;#39;publish&#38;#39;
	AND p1.ID = p2.ID&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>t31os_ on "Get Tags specific to  Category"</title>
<link>http://wordpress.org/support/topic/276635#post-1192678</link>
<pubDate>Sat, 29 Aug 2009 22:10:24 +0000</pubDate>
<dc:creator>t31os_</dc:creator>
<guid isPermaLink="false">1192678@http://wordpress.org/support/</guid>
<description>&#60;p&#62;Wow this is a tricky one, post_tags and categories sit in the same table...&#60;/p&#62;
&#60;p&#62;Just trying to get the query right first, here's what i have so far if anyone thinks they can help (just in phpmyadmin until i have the right query).&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;SELECT DISTINCT wp_posts.ID, wp_term_taxonomy.*, wp_terms.*
FROM wp_posts, wp_term_relationships, wp_term_taxonomy
JOIN wp_terms ON wp_term_taxonomy.term_taxonomy_id = wp_terms.term_id
WHERE wp_posts.ID = wp_term_relationships.object_id
AND wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id
AND wp_term_taxonomy.taxonomy = &#38;#39;post_tag&#38;#39;
LIMIT 0 , 300&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Anyone spot any immediate problems? .. Of course i'm still working on figuring out how to ensure posts match a set category, it's taken me a little while to get this far, not bad for a single query.. &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;Query took 0.0065 sec&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Mind you only 30 results on my install, but nice and fast, just need to figure out the rest of the query...&#60;/p&#62;
&#60;p&#62;Could really do with some help from someone who's written joins before. The above WHERE's act as JOINS, but i put a regular JOIN in to... it's a little beyond me if i'm to be frank, but i'll give it a shot nonetheless.... :) &#60;/p&#62;
&#60;p&#62;The real killer is how to join up the statement when post tags and categories sit in the same table, i can't quite wrap my head around how i can limit to one category, whilst still grabbing info on other entries in that very same table...  ** just need a fresh set of eyes i think **
&#60;/p&#62;</description>
</item>
<item>
<title>t31os_ on "Get Tags specific to  Category"</title>
<link>http://wordpress.org/support/topic/276635#post-1191841</link>
<pubDate>Fri, 28 Aug 2009 23:53:48 +0000</pubDate>
<dc:creator>t31os_</dc:creator>
<guid isPermaLink="false">1191841@http://wordpress.org/support/</guid>
<description>&#60;p&#62;I suppose the question is whether a get_results is more efficient then query_posts, if not then a custom joined query isn't going to be mean anything at this point and refining what you have would be best...&#60;/p&#62;
&#60;p&#62;Of course get_results in theory should be lighter and quicker, so perhaps a query that joins the various fields together will give the best results, but i'll have to spend some time looking over the tables (figure out the joins - mysql is not my strong suit).&#60;/p&#62;
&#60;p&#62;I'll see if i can write the query for you when i get some time to test it.... joins are a hair puller... lol..
&#60;/p&#62;</description>
</item>
<item>
<title>jasongeiger on "Get Tags specific to  Category"</title>
<link>http://wordpress.org/support/topic/276635#post-1191709</link>
<pubDate>Fri, 28 Aug 2009 21:13:51 +0000</pubDate>
<dc:creator>jasongeiger</dc:creator>
<guid isPermaLink="false">1191709@http://wordpress.org/support/</guid>
<description>&#60;p&#62;The goal of this was to be able to batch tags based on the category to develop a category specific list of tags, which in turn linked to that tags filtered archive.
&#60;/p&#62;</description>
</item>
<item>
<title>jasongeiger on "Get Tags specific to  Category"</title>
<link>http://wordpress.org/support/topic/276635#post-1191706</link>
<pubDate>Fri, 28 Aug 2009 21:11:32 +0000</pubDate>
<dc:creator>jasongeiger</dc:creator>
<guid isPermaLink="false">1191706@http://wordpress.org/support/</guid>
<description>&#60;p&#62;This what I've come up with. I think apljdi, is right about custom query. This still seems a bit excessive.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
        $project_query = query_posts(&#38;#39;category_name=projects&#38;#39;);
        while (have_posts()) : the_post();
            $posttags = get_the_tags();
            if ($posttags) {
                foreach($posttags as $tag) {
                    $all_tags_arr[] = $tag -&#38;gt; name; //USING JUST $tag MAKING $all_tags_arr A MULTI-DIMENSIONAL ARRAY, WHICH DOES WORK WITH array_unique
                }
            }
        endwhile;
    ?&#38;gt;
    &#38;lt;?php if ( is_array($all_tags_arr) &#38;amp;&#38;amp; count($all_tags_arr) &#38;gt; 0 ): ?&#38;gt;
&#38;lt;?php
    $tags_arr = array_unique($all_tags_arr); //REMOVES DUPLICATES
    foreach( $tags_arr as $tag ):
        $el = get_term_by(&#38;#39;name&#38;#39;, $tag, &#38;#39;post_tag&#38;#39;);
		$arr[] = &#38;#39;&#38;quot;tag-&#38;#39;.$el-&#38;gt;slug.&#38;#39;&#38;quot;&#38;#39;;
    ?&#38;gt;
    &#38;lt;span&#38;gt;&#38;lt;a href=&#38;quot;#&#38;lt;?php echo $el-&#38;gt;slug; ?&#38;gt;&#38;quot; id=&#38;quot;taglink-tag-&#38;lt;?php echo $el-&#38;gt;slug; ?&#38;gt;&#38;quot; rel=&#38;quot;tag-&#38;lt;?php echo $el-&#38;gt;slug; ?&#38;gt;&#38;quot;&#38;gt;&#38;lt;?php echo $el-&#38;gt;name; ?&#38;gt;&#38;lt;/a&#38;gt; &#38;lt;span class=&#38;quot;slash&#38;quot;&#38;gt;//&#38;lt;/span&#38;gt;&#38;lt;/span&#38;gt;
&#38;lt;?php endforeach; ?&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>t31os_ on "Get Tags specific to  Category"</title>
<link>http://wordpress.org/support/topic/276635#post-1188630</link>
<pubDate>Wed, 26 Aug 2009 14:01:51 +0000</pubDate>
<dc:creator>t31os_</dc:creator>
<guid isPermaLink="false">1188630@http://wordpress.org/support/</guid>
<description>&#60;p&#62;Can someone just clarify if you need the posts or just the tags?..&#60;/p&#62;
&#60;p&#62;If you need the posts to, then you might aswell build array items for each post, then at the end of all the posts, the array is finished, just remove dupes, then display the data..&#60;/p&#62;
&#60;p&#62;If you don't need posts, and just the post_tags, then this could be refined into a single stand-alone query, but if you're grabbing posts to there's no reason you can't just build the array as you display each post.. which is what you've got posted above... except that you've used query_posts simply to loop over each post in that category, but then you don't use any of the data, you're simplying using it in order to run get_the_tags, which of course is a little inefficient.&#60;/p&#62;
&#60;p&#62;Do you want post data or simply just the tags and nothing but the tags? (which it looks like was the intention).
&#60;/p&#62;</description>
</item>
<item>
<title>t31os_ on "Get Tags specific to  Category"</title>
<link>http://wordpress.org/support/topic/276635#post-1188556</link>
<pubDate>Wed, 26 Aug 2009 12:38:27 +0000</pubDate>
<dc:creator>t31os_</dc:creator>
<guid isPermaLink="false">1188556@http://wordpress.org/support/</guid>
<description>&#60;p&#62;So just to be clear the aim here is to grab post tags that exist for posts in one particular category?..&#60;/p&#62;
&#60;p&#62;I think we can proberly manage that.&#60;/p&#62;
&#60;ol&#62;
&#60;li&#62;Grab IDs for all posts in particular category&#60;/li&#62;
&#60;li&#62;Grab post tags for each post&#60;/li&#62;
&#60;li&#62;Remove duplicates&#60;/li&#62;
&#60;li&#62;Display data&#60;/li&#62;
&#60;/ol&#62;
&#60;p&#62;I think what's important is to not grab all post data when you only need the IDs.&#60;/p&#62;
&#60;p&#62;Give me a little while, i think i might be able to knock something up..
&#60;/p&#62;</description>
</item>
<item>
<title>apljdi on "Get Tags specific to  Category"</title>
<link>http://wordpress.org/support/topic/276635#post-1179726</link>
<pubDate>Tue, 18 Aug 2009 21:53:57 +0000</pubDate>
<dc:creator>apljdi</dc:creator>
<guid isPermaLink="false">1179726@http://wordpress.org/support/</guid>
<description>&#60;p&#62;I'd probably write the query from scratch. query_posts is pulling &#60;strong&#62;&#60;em&#62;a lot&#60;/em&#62; &#60;/strong&#62;of data you don't need. But that's not a query for the faint of heart...
&#60;/p&#62;</description>
</item>
<item>
<title>Minkowski on "Get Tags specific to  Category"</title>
<link>http://wordpress.org/support/topic/276635#post-1179690</link>
<pubDate>Tue, 18 Aug 2009 21:33:38 +0000</pubDate>
<dc:creator>Minkowski</dc:creator>
<guid isPermaLink="false">1179690@http://wordpress.org/support/</guid>
<description>&#60;p&#62;I too would like to find a more elegant solution to this.
&#60;/p&#62;</description>
</item>
<item>
<title>jasongeiger on "Get Tags specific to  Category"</title>
<link>http://wordpress.org/support/topic/276635#post-1097810</link>
<pubDate>Wed, 10 Jun 2009 23:57:03 +0000</pubDate>
<dc:creator>jasongeiger</dc:creator>
<guid isPermaLink="false">1097810@http://wordpress.org/support/</guid>
<description>&#60;p&#62;Electric Studio, that's not exactly what I was looking for but it was good stepping stone.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
	query_posts(&#38;#39;category_name=work&#38;#39;);
	if (have_posts()) : while (have_posts()) : the_post();
        $posttags = get_the_tags();
		if ($posttags) {
			foreach($posttags as $tag) {
				$all_tags_arr[] = $tag -&#38;gt; name; //USING JUST $tag MAKING $all_tags_arr A MULTI-DIMENSIONAL ARRAY, WHICH DOES WORK WITH array_unique
			}
		}
	endwhile; endif; 

	$tags_arr = array_unique($all_tags_arr); //REMOVES DUPLICATES
	echo &#38;#39;&#38;lt;pre&#38;gt;&#38;#39;.print_r($tags_arr, true).&#38;#39;&#38;lt;/pre&#38;gt;&#38;#39;; //OUTPUT FINAL TAGS FROM CATEGORY

?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;This does the job, except it would be nice to have $tags_arr as a multi-dimensional array but that does work with array_unique.&#60;/p&#62;
&#60;p&#62;Still my question is, if you have say 100 posts in a category, is doing query like this the most efficient way of getting these results.
&#60;/p&#62;</description>
</item>
<item>
<title>Electric Studio on "Get Tags specific to  Category"</title>
<link>http://wordpress.org/support/topic/276635#post-1096481</link>
<pubDate>Tue, 09 Jun 2009 19:33:00 +0000</pubDate>
<dc:creator>Electric Studio</dc:creator>
<guid isPermaLink="false">1096481@http://wordpress.org/support/</guid>
<description>&#60;p&#62;OK, this is what i have done, much more basic than i thought:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;ul&#38;gt;
&#38;lt;?php global $post;
		     $myposts = get_posts(&#38;#39;numberposts=-1&#38;amp;offset=0&#38;amp;category=13&#38;amp;order=DESC&#38;#39;);
		     foreach($myposts as $post) :
	?&#38;gt;
	&#38;lt;li&#38;gt;
    &#38;lt;?php if(get_post_meta($post-&#38;gt;ID, &#38;#39;Event Name&#38;#39;, true)): ?&#38;gt;&#38;lt;?php echo get_post_meta($post-&#38;gt;ID, &#38;#39;Event Name&#38;#39;, true); ?&#38;gt;&#38;lt;br /&#38;gt;&#38;lt;?php endif; ?&#38;gt;
	&#38;lt;?php if(get_post_meta($post-&#38;gt;ID, &#38;#39;Event Location&#38;#39;, true)): ?&#38;gt;&#38;lt;?php echo get_post_meta($post-&#38;gt;ID, &#38;#39;Event Location&#38;#39;, true); ?&#38;gt;&#38;lt;br /&#38;gt;&#38;lt;?php endif; ?&#38;gt;
    &#38;lt;?php if(get_post_meta($post-&#38;gt;ID, &#38;#39;Event Date Day&#38;#39;, true)): ?&#38;gt;&#38;lt;?php echo get_post_meta($post-&#38;gt;ID, &#38;#39;Event Date Day&#38;#39;, true); ?&#38;gt;&#38;lt;br /&#38;gt;&#38;lt;?php endif; ?&#38;gt;
    &#38;lt;?php if(get_post_meta($post-&#38;gt;ID, &#38;#39;Event Date Month&#38;#39;, true)): ?&#38;gt;&#38;lt;?php echo get_post_meta($post-&#38;gt;ID, &#38;#39;Event Date Month&#38;#39;, true); ?&#38;gt;&#38;lt;br /&#38;gt;&#38;lt;?php endif; ?&#38;gt;
    &#38;lt;?php if(get_post_meta($post-&#38;gt;ID, &#38;#39;Event Date Year&#38;#39;, true)): ?&#38;gt;&#38;lt;?php echo get_post_meta($post-&#38;gt;ID, &#38;#39;Event Date Year&#38;#39;, true); ?&#38;gt;&#38;lt;br /&#38;gt;&#38;lt;?php endif; ?&#38;gt;
    &#38;lt;?php if(get_post_meta($post-&#38;gt;ID, &#38;#39;Event Time&#38;#39;, true)): ?&#38;gt;&#38;lt;?php echo get_post_meta($post-&#38;gt;ID, &#38;#39;Event Time&#38;#39;, true); ?&#38;gt;&#38;lt;br /&#38;gt;&#38;lt;?php endif; ?&#38;gt;
	&#38;lt;/li&#38;gt;
	&#38;lt;?php endforeach; ?&#38;gt;
&#38;lt;/ul&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Hopefully this will help someone.
&#60;/p&#62;</description>
</item>
<item>
<title>Electric Studio on "Get Tags specific to  Category"</title>
<link>http://wordpress.org/support/topic/276635#post-1096413</link>
<pubDate>Tue, 09 Jun 2009 18:19:48 +0000</pubDate>
<dc:creator>Electric Studio</dc:creator>
<guid isPermaLink="false">1096413@http://wordpress.org/support/</guid>
<description>&#60;p&#62;Bump, exactly what I'm looking for too. I want to grab the Meta data from multiple posts in one category, then loop it out nicely at the bottom of a page/in a sidebar etc.&#60;/p&#62;
&#60;p&#62;Any friendlies  out there?
&#60;/p&#62;</description>
</item>
<item>
<title>jasongeiger on "Get Tags specific to  Category"</title>
<link>http://wordpress.org/support/topic/276635#post-1092278</link>
<pubDate>Fri, 05 Jun 2009 01:10:49 +0000</pubDate>
<dc:creator>jasongeiger</dc:creator>
<guid isPermaLink="false">1092278@http://wordpress.org/support/</guid>
<description>&#60;p&#62;I've noticed there is no native way to retrieve tags based on the category. I've seen a few plugins that do something similar but don't this. There have also been been a few snippets posted that kinda do it but either show duplicates of tags, or seem too labor intensive.&#60;/p&#62;
&#60;p&#62;In short has anyone done a db query as follows:&#60;/p&#62;
&#60;p&#62;select category&#60;br /&#62;
from category select posts&#60;br /&#62;
from posts select post tags&#60;br /&#62;
make array of unique post tags (id, name, slug)&#60;/p&#62;
&#60;p&#62;I've started playing with the query function but as I'm learning and shooting in dark.&#60;/p&#62;
&#60;p&#62;Any help, even a quick tut on how to run a query would be helpful.
&#60;/p&#62;</description>
</item>

</channel>
</rss>
