<?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>Josh Stauffer&#187; Snippets</title>
	<atom:link href="http://www.joshstauffer.com/category/snippets/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.joshstauffer.com</link>
	<description>WordPress, Genesis, &#38; Things I Care About</description>
	<lastBuildDate>Sun, 11 Dec 2011 01:08:20 +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>Genesis Framework Snippets</title>
		<link>http://www.joshstauffer.com/genesis-framework-snippets/</link>
		<comments>http://www.joshstauffer.com/genesis-framework-snippets/#comments</comments>
		<pubDate>Tue, 10 May 2011 13:43:17 +0000</pubDate>
		<dc:creator>Josh Stauffer</dc:creator>
				<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Genesis Framework]]></category>

		<guid isPermaLink="false">http://www.joshstauffer.com/?p=558</guid>
		<description><![CDATA[This will become my personal snippet library for the Genesis Framework. Since it is a work in progress, here are some other resources for Genesis code snippets: http://dev.studiopress.com/sitemap http://www.billerickson.net/genesis-quick-tips/ http://gregrickaby.com/2011/02/add-remove-genesis-elements.html http://genesistutorials.com/snippets http://shaynesanderson.com/blog/2011/05/24/handy-genesis-functions/ http://wpsmith.net/category/tutorials/ http://www.briangardner.com/code/ Related posts:Genesis: How to Add an Additional Wrap Genesis Framework: List of Theme and Location Constants Redesign &#8211; March 2011


Related posts:<ol><li><a href='http://www.joshstauffer.com/genesis-add-wrap/' rel='bookmark' title='Permanent Link: Genesis: How to Add an Additional Wrap'>Genesis: How to Add an Additional Wrap</a></li>
<li><a href='http://www.joshstauffer.com/genesis-framework-constants/' rel='bookmark' title='Permanent Link: Genesis Framework: List of Theme and Location Constants'>Genesis Framework: List of Theme and Location Constants</a></li>
<li><a href='http://www.joshstauffer.com/redesign-march-2011/' rel='bookmark' title='Permanent Link: Redesign &#8211; March 2011'>Redesign &#8211; March 2011</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.joshstauffer.com%2Fgenesis-framework-snippets%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.joshstauffer.com%2Fgenesis-framework-snippets%2F&amp;source=joshstauffer&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>This will become my personal snippet library for the Genesis Framework. Since it is a work in progress, here are some other resources for Genesis code snippets:</p>
<ul>
<li><a href="http://dev.studiopress.com/sitemap">http://dev.studiopress.com/sitemap</a></li>
<li><a href="http://www.billerickson.net/genesis-quick-tips/">http://www.billerickson.net/genesis-quick-tips/</a></li>
<li><a href="http://gregrickaby.com/2011/02/add-remove-genesis-elements.html">http://gregrickaby.com/2011/02/add-remove-genesis-elements.html</a></li>
<li><a href="http://genesistutorials.com/snippets">http://genesistutorials.com/snippets</a></li>
<li><a href="http://shaynesanderson.com/blog/2011/05/24/handy-genesis-functions/">http://shaynesanderson.com/blog/2011/05/24/handy-genesis-functions/</a></li>
<li><a href="http://wpsmith.net/category/tutorials/">http://wpsmith.net/category/tutorials/</a></li>
<li><a href="http://www.briangardner.com/code/">http://www.briangardner.com/code/</a></li>
</ul>
<pre class="brush: php; title: ; notranslate">/* Source: http://dev.studiopress.com/add-widgeted-footer.htm */
/* Add support for 3-column footer widgets */
add_theme_support( 'genesis-footer-widgets', 3 );</pre>


<p>Related posts:<ol><li><a href='http://www.joshstauffer.com/genesis-add-wrap/' rel='bookmark' title='Permanent Link: Genesis: How to Add an Additional Wrap'>Genesis: How to Add an Additional Wrap</a></li>
<li><a href='http://www.joshstauffer.com/genesis-framework-constants/' rel='bookmark' title='Permanent Link: Genesis Framework: List of Theme and Location Constants'>Genesis Framework: List of Theme and Location Constants</a></li>
<li><a href='http://www.joshstauffer.com/redesign-march-2011/' rel='bookmark' title='Permanent Link: Redesign &#8211; March 2011'>Redesign &#8211; March 2011</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.joshstauffer.com/genesis-framework-snippets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress: Get Tags for a Specific Category</title>
		<link>http://www.joshstauffer.com/wordpress-get-tags-for-a-specific-category/</link>
		<comments>http://www.joshstauffer.com/wordpress-get-tags-for-a-specific-category/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 15:08:19 +0000</pubDate>
		<dc:creator>Josh Stauffer</dc:creator>
				<category><![CDATA[Snippets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.joshstauffer.com/?p=266</guid>
		<description><![CDATA[WordPress is such a powerful tool out of the box that it is surprising to find something that it doesn&#8217;t have a function for. Here is a code snippet that will allow you to show tags that are related to a specific category. The nice thing about this snippet is that it does not require [...]


Related posts:<ol><li><a href='http://www.joshstauffer.com/display-the-latest-posts-with-wordpress/' rel='bookmark' title='Permanent Link: Display the Latest Posts with WordPress'>Display the Latest Posts with WordPress</a></li>
<li><a href='http://www.joshstauffer.com/see-websites-search-engine-result-for-a-specific-keyword/' rel='bookmark' title='Permanent Link: See Website&#8217;s Search Engine Result for a Specific Keyword'>See Website&#8217;s Search Engine Result for a Specific Keyword</a></li>
<li><a href='http://www.joshstauffer.com/genesis-framework-snippets/' rel='bookmark' title='Permanent Link: Genesis Framework Snippets'>Genesis Framework Snippets</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.joshstauffer.com%2Fwordpress-get-tags-for-a-specific-category%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.joshstauffer.com%2Fwordpress-get-tags-for-a-specific-category%2F&amp;source=joshstauffer&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>WordPress is such a powerful tool out of the box that it is surprising to find something that it doesn&#8217;t have a function for. Here is a code snippet that will allow you to show tags that are related to a specific category. The nice thing about this snippet is that it does not require any complicated custom DB queries but uses WordPress&#8217; built in features.</p>
<p>It is as simple as pasting this code wherever you would like to display tags for a specific category. If you would like to change the appearance of the tags, take a look at the options available for <a href="http://codex.wordpress.org/Template_Tags/wp_tag_cloud" target="_blank" rel="nofollow">wp_tag_cloud()</a>. Don&#8217;t forget to change the category name on line 1.</p>
<pre><code>&lt;?php
$custom_query = new WP_Query(&#39;posts_per_page=-1&amp;category_name=blog&#39;);
if ($custom_query-&gt;have_posts()) :
	while ($custom_query-&gt;have_posts()) : $custom_query-&gt;the_post();
		$posttags = get_the_tags();
		if ($posttags) {
			foreach($posttags as $tag) {
				$all_tags[] = $tag-&gt;term_id;
			}
		}
	endwhile;
endif;

$tags_arr = array_unique($all_tags);
$tags_str = implode(&quot;,&quot;, $tags_arr);

$args = array(
&#39;smallest&#39;  =&gt; 12,
&#39;largest&#39;   =&gt; 12,
&#39;unit&#39;      =&gt; &#39;px&#39;,
&#39;number&#39;    =&gt; 0,
&#39;format&#39;    =&gt; &#39;list&#39;,
&#39;include&#39;   =&gt; $tags_str
);
wp_tag_cloud($args);
?&gt;</code></pre>


<p>Related posts:<ol><li><a href='http://www.joshstauffer.com/display-the-latest-posts-with-wordpress/' rel='bookmark' title='Permanent Link: Display the Latest Posts with WordPress'>Display the Latest Posts with WordPress</a></li>
<li><a href='http://www.joshstauffer.com/see-websites-search-engine-result-for-a-specific-keyword/' rel='bookmark' title='Permanent Link: See Website&#8217;s Search Engine Result for a Specific Keyword'>See Website&#8217;s Search Engine Result for a Specific Keyword</a></li>
<li><a href='http://www.joshstauffer.com/genesis-framework-snippets/' rel='bookmark' title='Permanent Link: Genesis Framework Snippets'>Genesis Framework Snippets</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.joshstauffer.com/wordpress-get-tags-for-a-specific-category/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>JavaScript: 3 Ways to Use document.write</title>
		<link>http://www.joshstauffer.com/ways-to-use-document-write/</link>
		<comments>http://www.joshstauffer.com/ways-to-use-document-write/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 14:58:06 +0000</pubDate>
		<dc:creator>Josh Stauffer</dc:creator>
				<category><![CDATA[Snippets]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.joshstauffer.com/?p=253</guid>
		<description><![CDATA[The document.write command is a standard, yet powerful, JavaScript command for writing output to a page. In this article I&#8217;ve outline 3 ways to use document.write statements. Example 1 &#60;script type="text/javascript"&#62; document.write('&#60;div&#62;'); document.write(' &#60;h4&#62;Example 1 using document.write&#60;/h4&#62;'); document.write(' &#60;p&#62;This example uses multiple document.write commands to write ouput to a page.&#60;/p&#62;'); document.write('&#60;/div&#62;'); &#60;/script&#62; Example 2 &#60;script [...]


Related posts:<ol><li><a href='http://www.joshstauffer.com/track-404s-with-google-analytics/' rel='bookmark' title='Permanent Link: Simple Way to Track 404 Error Pages with Google Analytics'>Simple Way to Track 404 Error Pages with Google Analytics</a></li>
<li><a href='http://www.joshstauffer.com/how-to-install-google-analytics-on-wordpress/' rel='bookmark' title='Permanent Link: How to Install Google Analytics on WordPress'>How to Install Google Analytics on WordPress</a></li>
<li><a href='http://www.joshstauffer.com/neat-pop-up-windows-for-images/' rel='bookmark' title='Permanent Link: Neat Pop-up Windows for Images'>Neat Pop-up Windows for Images</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.joshstauffer.com%2Fways-to-use-document-write%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.joshstauffer.com%2Fways-to-use-document-write%2F&amp;source=joshstauffer&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>The <strong><a class="track" rel="nofollow" href="http://www.w3schools.com/JS/js_howto.asp" target="_blank">document.write</a></strong> command is a standard, yet powerful, JavaScript command for writing output to a page. In this article I&#8217;ve outline 3 ways to use document.write statements.</p>
<p><span id="more-253"></span></p>
<h3>Example 1</h3>
<pre><code>&lt;script type="text/javascript"&gt;
document.write('&lt;div&gt;');
document.write('	&lt;h4&gt;Example 1 using document.write&lt;/h4&gt;');
document.write('	&lt;p&gt;This example uses multiple document.write commands to write ouput to a page.&lt;/p&gt;');
document.write('&lt;/div&gt;');
&lt;/script&gt;</code></pre>
<h3>Example 2</h3>
<pre><code>&lt;script type="text/javascript"&gt;
var output = '';
output  = '&lt;div&gt;';
output  = '	&lt;h4&gt;Example 2 using document.write&lt;/h4&gt;';
output  = '	&lt;p&gt;This example uses a lengthy string and a single document.write command to write ouput to a page.&lt;/p&gt;';
output  = '&lt;/div&gt;';
document.write(output);
&lt;/script&gt;</code></pre>
<h3>Example 3</h3>
<pre><code>&lt;script type="text/javascript"&gt;
var output = [
'&lt;div&gt;',
'	&lt;h4&gt;Example 3 using document.write&lt;/h4&gt;',
'	&lt;p&gt;This example uses an array and a single document.write command to write output to a page.&lt;/p&gt;',
'&lt;/div&gt;'
];
document.write(output.join('\n'));
&lt;/script&gt;</code></pre>
<p><strong><a rel="nofollow" href="http://www.joshstauffer.com/demos/using-document-write/" target="_blank">View live demonstration</a></strong> with all 3 examples.</p>


<p>Related posts:<ol><li><a href='http://www.joshstauffer.com/track-404s-with-google-analytics/' rel='bookmark' title='Permanent Link: Simple Way to Track 404 Error Pages with Google Analytics'>Simple Way to Track 404 Error Pages with Google Analytics</a></li>
<li><a href='http://www.joshstauffer.com/how-to-install-google-analytics-on-wordpress/' rel='bookmark' title='Permanent Link: How to Install Google Analytics on WordPress'>How to Install Google Analytics on WordPress</a></li>
<li><a href='http://www.joshstauffer.com/neat-pop-up-windows-for-images/' rel='bookmark' title='Permanent Link: Neat Pop-up Windows for Images'>Neat Pop-up Windows for Images</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.joshstauffer.com/ways-to-use-document-write/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

