<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>bsdeluxe &#187; tags</title>
	<atom:link href="http://www.bsdeluxe.com/tag/tags/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bsdeluxe.com</link>
	<description>...is Bob Sherron</description>
	<lastBuildDate>Tue, 29 Nov 2011 15:04:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Making a WordPress Tag Cloug That Respects query_posts()</title>
		<link>http://www.bsdeluxe.com/making-a-wordpress-tag-cloug-that-respects-query_posts/</link>
		<comments>http://www.bsdeluxe.com/making-a-wordpress-tag-cloug-that-respects-query_posts/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 19:57:25 +0000</pubDate>
		<dc:creator>Bob Sherron</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[query_posts]]></category>
		<category><![CDATA[tags]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.bsdeluxe.com/?p=6</guid>
		<description><![CDATA[In which the author bends Wordpress to his will, yet again.]]></description>
			<content:encoded><![CDATA[<p>Tag clouds are a Thing. I mean, don&#8217;t get me wrong, I&#8217;m sure they are useful. But a certain type of people just LOVE tag clouds. This post isn&#8217;t about if they are awesome or if they are lame, but rather about how to make a WordPress tag cloud respect your authority, especially when using <a href="http://codex.wordpress.org/Template_Tags/query_posts">query_posts()</a> to trim down the posts on a specific page.</p>
<p>You see, if you are using query_posts() to choose a subset of your posts, you probably don&#8217;t want the tags for posts that aren&#8217;t on that page to show in that tag cloud. Unfortunately, the default WordPress tag cloud gets the whole frigging taxonomy and that&#8217;s no fun for anyone. The approach I took was to make a second loop and snag the tags out of the posts that are in play. <strong>This approach might not work for you, </strong>but it worked for my needs at the time.</p>
<p>Here&#8217;s the code:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">function qp_tag_cloud() {<br />
&nbsp; $tags = array();<br />
&nbsp; if ( have_posts() ) : while ( have_posts() ) : the_post();<br />
&nbsp; &nbsp; if (get_the_tags() ) {<br />
&nbsp; &nbsp; &nbsp; foreach(get_the_tags() as $tag) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; $tags[$tag-&amp;gt;term_id] = $tag-&amp;gt;name;<br />
&nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; }<br />
&nbsp; endwhile;<br />
&nbsp; endif;<br />
&nbsp; foreach ($tags as $key=&amp;gt;$value) {<br />
&nbsp; &nbsp; echo &quot;&amp;lt;a href=&quot;&quot;. get_tag_link($key) .&quot;&quot;&amp;gt;&quot; . $value . &quot;&amp;lt;/a&amp;gt;&quot;;<br />
&nbsp; }<br />
}</div></div>
<p>OK, so this is more of a list of tags than a tag cloud. Anyway. Hope this helps someone, as there was very little helpfulness out in the Google about this issue. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bsdeluxe.com/making-a-wordpress-tag-cloug-that-respects-query_posts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

