<?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>tgrayimages.com &#187; WordPress</title>
	<atom:link href="http://tgrayimages.com/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://tgrayimages.com</link>
	<description>Designs by Tony Gray</description>
	<lastBuildDate>Fri, 03 Feb 2012 23:04:32 +0000</lastBuildDate>
	<language>en</language>
	<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>iPhone 4 sweetness! :D #iphone&#8230;</title>
		<link>http://tgrayimages.com/iphone-4-sweetness-d-iphone/</link>
		<comments>http://tgrayimages.com/iphone-4-sweetness-d-iphone/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 17:40:53 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tweets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tgrayimages.com/iphone-4-sweetness-d-iphone/</guid>
		<description><![CDATA[iPhone 4 sweetness!   #iphone4
]]></description>
			<content:encoded><![CDATA[<p>iPhone 4 sweetness! <img src='http://tgrayimages.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  #<a href="http://search.twitter.com/search?q=%23iphone4" class="aktt_hashtag">iphone4</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tgrayimages.com/iphone-4-sweetness-d-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nothing wimpy but the name htt&#8230;</title>
		<link>http://tgrayimages.com/nothing-wimpy-but-the-name-htt/</link>
		<comments>http://tgrayimages.com/nothing-wimpy-but-the-name-htt/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 19:23:00 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tweets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tgrayimages.com/nothing-wimpy-but-the-name-htt/</guid>
		<description><![CDATA[Nothing wimpy but the name http://yfrog.com/7hliuoj
]]></description>
			<content:encoded><![CDATA[<p>Nothing wimpy but the name <a href="http://yfrog.com/7hliuoj" rel="nofollow">http://yfrog.com/7hliuoj</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tgrayimages.com/nothing-wimpy-but-the-name-htt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>@jtoddmason just exercise more&#8230;</title>
		<link>http://tgrayimages.com/jtoddmason-just-exercise-more/</link>
		<comments>http://tgrayimages.com/jtoddmason-just-exercise-more/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 17:13:45 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tweets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tgrayimages.com/jtoddmason-just-exercise-more/</guid>
		<description><![CDATA[@jtoddmason just exercise more!
]]></description>
			<content:encoded><![CDATA[<p>@<a href="http://twitter.com/jtoddmason" class="aktt_username">jtoddmason</a> just exercise more!</p>
]]></content:encoded>
			<wfw:commentRss>http://tgrayimages.com/jtoddmason-just-exercise-more/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>French Fries are not a vegetab&#8230;</title>
		<link>http://tgrayimages.com/french-fries-are-not-a-vegetab/</link>
		<comments>http://tgrayimages.com/french-fries-are-not-a-vegetab/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 22:16:34 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tweets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tgrayimages.com/french-fries-are-not-a-vegetab/</guid>
		<description><![CDATA[French Fries are not a vegetable! http://tinyurl.com/23jfe47
]]></description>
			<content:encoded><![CDATA[<p>French Fries are not a vegetable! <a href="http://tinyurl.com/23jfe47" rel="nofollow">http://tinyurl.com/23jfe47</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tgrayimages.com/french-fries-are-not-a-vegetab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drag and Drop Gmail Attachment&#8230;</title>
		<link>http://tgrayimages.com/drag-and-drop-gmail-attachment/</link>
		<comments>http://tgrayimages.com/drag-and-drop-gmail-attachment/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 00:29:37 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tweets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tgrayimages.com/drag-and-drop-gmail-attachment/</guid>
		<description><![CDATA[Drag and Drop Gmail Attachments http://bit.ly/a235g7
]]></description>
			<content:encoded><![CDATA[<p>Drag and Drop Gmail Attachments <a href="http://bit.ly/a235g7" rel="nofollow">http://bit.ly/a235g7</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tgrayimages.com/drag-and-drop-gmail-attachment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>He is risen!</title>
		<link>http://tgrayimages.com/he-is-risen/</link>
		<comments>http://tgrayimages.com/he-is-risen/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 13:37:37 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tweets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tgrayimages.com/he-is-risen/</guid>
		<description><![CDATA[He is risen!
]]></description>
			<content:encoded><![CDATA[<p>He is risen!</p>
]]></content:encoded>
			<wfw:commentRss>http://tgrayimages.com/he-is-risen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Touch my egg and I&#8217;ll bite you&#8230;</title>
		<link>http://tgrayimages.com/touch-my-egg-and-ill-bite-you/</link>
		<comments>http://tgrayimages.com/touch-my-egg-and-ill-bite-you/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 05:08:36 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tweets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tgrayimages.com/touch-my-egg-and-ill-bite-you/</guid>
		<description><![CDATA[Touch my egg and I&#8217;ll bite you.  I&#8217;ve had a rough day! http://tinyurl.com/y9hmanl
]]></description>
			<content:encoded><![CDATA[<p>Touch my egg and I&#8217;ll bite you.  I&#8217;ve had a rough day! <a href="http://tinyurl.com/y9hmanl" rel="nofollow">http://tinyurl.com/y9hmanl</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tgrayimages.com/touch-my-egg-and-ill-bite-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sunday&#8217;s coming!!</title>
		<link>http://tgrayimages.com/sundays-coming/</link>
		<comments>http://tgrayimages.com/sundays-coming/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 14:05:42 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tweets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tgrayimages.com/sundays-coming/</guid>
		<description><![CDATA[Sunday&#8217;s coming!!
]]></description>
			<content:encoded><![CDATA[<p>Sunday&#8217;s coming!!</p>
]]></content:encoded>
			<wfw:commentRss>http://tgrayimages.com/sundays-coming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>COMBO! http://tinyurl.com/y9cy&#8230;</title>
		<link>http://tgrayimages.com/combo-httptinyurl-comy9cy/</link>
		<comments>http://tgrayimages.com/combo-httptinyurl-comy9cy/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 19:08:57 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tweets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tgrayimages.com/combo-httptinyurl-comy9cy/</guid>
		<description><![CDATA[COMBO! http://tinyurl.com/y9cy9ep
]]></description>
			<content:encoded><![CDATA[<p>COMBO! <a href="http://tinyurl.com/y9cy9ep" rel="nofollow">http://tinyurl.com/y9cy9ep</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tgrayimages.com/combo-httptinyurl-comy9cy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I got the Mac Heist bundle. 7 &#8230;</title>
		<link>http://tgrayimages.com/i-got-the-mac-heist-bundle-7/</link>
		<comments>http://tgrayimages.com/i-got-the-mac-heist-bundle-7/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 23:37:44 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tweets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tgrayimages.com/i-got-the-mac-heist-bundle-7/</guid>
		<description><![CDATA[I got the Mac Heist bundle. 7 fantastic Mac apps worth $260+ for only $19.95 and got 3 sweet bonus apps free! http://bit.ly/heist-it
]]></description>
			<content:encoded><![CDATA[<p>I got the Mac Heist bundle. 7 fantastic Mac apps worth $260+ for only $19.95 and got 3 sweet bonus apps free! <a href="http://bit.ly/heist-it" rel="nofollow">http://bit.ly/heist-it</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tgrayimages.com/i-got-the-mac-heist-bundle-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>what&#8217;s all the buzz about?</title>
		<link>http://tgrayimages.com/whats-all-the-buzz-about/</link>
		<comments>http://tgrayimages.com/whats-all-the-buzz-about/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 04:04:05 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tweets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tgrayimages.com/whats-all-the-buzz-about/</guid>
		<description><![CDATA[what&#8217;s all the buzz about?
]]></description>
			<content:encoded><![CDATA[<p>what&#8217;s all the buzz about?</p>
]]></content:encoded>
			<wfw:commentRss>http://tgrayimages.com/whats-all-the-buzz-about/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automate File Attachments on y&#8230;</title>
		<link>http://tgrayimages.com/automate-file-attachments-on-y/</link>
		<comments>http://tgrayimages.com/automate-file-attachments-on-y/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 04:49:27 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tweets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tgrayimages.com/automate-file-attachments-on-y/</guid>
		<description><![CDATA[Automate File Attachments on your WordPress Posts http://bit.ly/5A7HFH #wordpress
]]></description>
			<content:encoded><![CDATA[<p>Automate File Attachments on your WordPress Posts <a href="http://bit.ly/5A7HFH" rel="nofollow">http://bit.ly/5A7HFH</a> #<a href="http://search.twitter.com/search?q=%23wordpress" class="aktt_hashtag">wordpress</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tgrayimages.com/automate-file-attachments-on-y/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automate File Attachments on your WordPress Posts</title>
		<link>http://tgrayimages.com/automate-file-attachments-on-your-wordpress-posts/</link>
		<comments>http://tgrayimages.com/automate-file-attachments-on-your-wordpress-posts/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 07:12:28 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tgrayimages.com/?p=1424</guid>
		<description><![CDATA[UPDATE 4/24/2010: I updated the audio section to automatically wrap the audio with the flash player based on the example provided by Joseph Hinson
I&#8217;ve been coding WordPress sites for 4 or 5 years now. The more I use it, the more I love it. WordPress is an awesome CMS tool. When I create a site [...]]]></description>
			<content:encoded><![CDATA[<p>UPDATE 4/24/2010: I updated the audio section to automatically wrap the audio with the flash player based on the example provided by <a href="http://buildinternet.com/2010/04/adding-mp3-files-to-wordpress-themes/">Joseph Hinson</a></p>
<p>I&#8217;ve been coding WordPress sites for 4 or 5 years now. The more I use it, the more I love it. WordPress is an awesome CMS tool. When I create a site for a client, I want the site to be as easy as possible for a &#8220;non&#8221; web designer/developer types to maintain. One of my latest clients wanted to be able to create a post and attach a file for download. The client found it a little confusing to attach the file to a post and then include that file as a link. They also wanted to show an icon specific to the document type they had uploaded. With a little code, I was able to automate the process of linking to files attached to a WordPress post and specify the icon based on the files MIME type. There are plenty of articles on the web about WordPress attachments so I&#8217;m not going into any detail about that. Here is an article on attachments by Jeff Starr I&#8217;ve bookmarked for reference. <a href="http://digwp.com/2009/08/awesome-image-attachment-recipes-for-wordpress/">Digging into WordPress</a></p>
<p>Here is an example of what we are about to create. I&#8217;ve attached several sample files to this post and that&#8217;s it. By the way, the zip file listed below is a zip of all the icons for you to download.</p>
<div id="junk" style="clear: both;"><div class='documentIconsWrapper'> 
<div class='documentIcons'><a href='http://tgrayimages.com/media/2010/01/2010-01-03-AM.pdf'><img src='http://tgrayimages.com/wp-content/themes/tg5/images/mime/pdf.png'/></a><br><a href='http://tgrayimages.com/media/2010/01/2010-01-03-AM.pdf'>2010-01-03-AM.pdf</a></div><div class='documentIcons'><a href='http://tgrayimages.com/media/2010/01/test.docx'><img src='http://tgrayimages.com/wp-content/themes/tg5/images/mime/word.png'/></a><br><a href='http://tgrayimages.com/media/2010/01/test.docx'>test.docx</a></div><div class='documentIcons'><a href='http://tgrayimages.com/media/2010/01/test.doc'><img src='http://tgrayimages.com/wp-content/themes/tg5/images/mime/word.png'/></a><br><a href='http://tgrayimages.com/media/2010/01/test.doc'>test.doc</a></div><div class='documentIcons'><a href='http://tgrayimages.com/media/2010/01/Presentation.pptx'><img src='http://tgrayimages.com/wp-content/themes/tg5/images/mime/PowerPoint.png'/></a><br><a href='http://tgrayimages.com/media/2010/01/Presentation.pptx'>Presentation.pptx</a></div><div class='documentIcons'><a href='http://tgrayimages.com/media/2010/01/Presentation.ppt'><img src='http://tgrayimages.com/wp-content/themes/tg5/images/mime/PowerPoint.png'/></a><br><a href='http://tgrayimages.com/media/2010/01/Presentation.ppt'>Presentation.ppt</a></div><div class='documentIcons'><a href='http://tgrayimages.com/media/2010/01/Workbook1.xlsx'><img src='http://tgrayimages.com/wp-content/themes/tg5/images/mime/XLS8.png'/></a><br><a href='http://tgrayimages.com/media/2010/01/Workbook1.xlsx'>Workbook1.xlsx</a></div><div class='documentIcons'><a href='http://tgrayimages.com/media/2010/01/Workbook1.xls'><img src='http://tgrayimages.com/wp-content/themes/tg5/images/mime/XLS8.png'/></a><br><a href='http://tgrayimages.com/media/2010/01/Workbook1.xls'>Workbook1.xls</a></div><div class='documentIcons'><a href='http://tgrayimages.com/media/2010/01/icons.zip'><img src='http://tgrayimages.com/wp-content/themes/tg5/images/mime/zip.png'/></a><br><a href='http://tgrayimages.com/media/2010/01/icons.zip'>icons.zip</a></div><ul class='audiofiles'><li><h4 class='title'>Jeopardy Think Music</h4><object width='470' height='24' id='single1451' name='single1451'><param name='movie' value='player.swf'><param name='allowfullscreen' value='true'><param name='allowscriptaccess' value='always'><param name='wmode' value='transparent'><param name='flashvars' value='file=http://www.tgrayimages.com/media/2010/01/Jeopardy-Think-Music.mp3'><embed id='single1451' name='single1451' src='http://tgrayimages.com/wp-content/themes/tg5/jw/player.swf' width='470' height='24' bgcolor='#ffffff' allowscriptaccess='always' allowfullscreen='true' flashvars='file=http://www.tgrayimages.com/media/2010/01/Jeopardy-Think-Music.mp3' /></object><a href='http://www.tgrayimages.com/media/2010/01/Jeopardy-Think-Music.mp3'>Download</a></li></ul></div></div>
<p>First let&#8217;s create the function and the shortcode. Go to your themes folder and open functions.php. If you don&#8217;t have one, just create a new file named functions.php and save it to your themes folder.</p>
<p>Create a new function with the following code.</p>
<pre><code>function get_attachment_icons($echo = false){
	//PDF Documents
	if ( $files = get_children(array(   //do only if there are attachments of these qualifications
	 'post_parent' =&gt; get_the_ID(),
	 'post_type' =&gt; 'attachment',
	 'numberposts' =&gt; -1,
	 'post_mime_type' =&gt; 'application/pdf',  //MIME Type condition
	 ))){
	 foreach( $files as $file ){ //setup array for more than one file attachment
		$file_link = wp_get_attachment_url($file-&gt;ID);    //get the url for linkage
		$file_name_array=explode("/",$file_link);
		$file_name=array_reverse($file_name_array);  //creates an array out of the url and grabs the filename
		$sAttachmentString .= "&lt;div class='documentIcons'&gt;";
		$sAttachmentString .= "&lt;a href='$file_link'&gt;";
		$sAttachmentString .= "&lt;img src='".get_bloginfo('template_directory')."/images/mime/pdf.png'/&gt;";
		$sAttachmentString .= "&lt;/a&gt;";
		$sAttachmentString .= "&lt;br&gt;";
		$sAttachmentString .= "&lt;a href='$file_link'&gt;$file_name[0]&lt;/a&gt;";
		$sAttachmentString .= "&lt;/div&gt;";
		}
	}
</code></pre>
<p>This block is for PDF files. You can tell that by the line that says <span class="code">&#8216;post_mime_type&#8217; =&gt; &#8216;application/pdf&#8217;,</span>. Just change the MIME type for the type of file you are expecting.  In the final code, I&#8217;ve added a new loop for each MIME type below:</p>
<ul style="margin: 0 0 20px 40px;">
<li>PDF = application/pdf</li>
<li>Word Documents = application/msword</li>
<li>PowerPoint = application/vnd.ms-powerpoint</li>
<li>Excel = application/vnd.ms-excel</li>
<li>Zip = application/zip</li>
<li>Audio files = audio/mpeg</li>
</ul>
<p>Now at the bottom of the function we will add the hook for the shortcode and we&#8217;re done!</p>
<pre><code>add_shortcode('attachment icons', 'get_attachment_icons');</code></pre>
<h3>Usage</h3>
<p>Just include a shortcode in any post</p>
<pre><code>&#91;attachment icons]</code></pre>
<p>or place one line in your single.php file (or where ever you&#8217;d like the document icons to show up)</p>
<pre><code>&lt;?php get_attachment_icons($echo=true); ?&gt;</code></pre>
<h3>Final Code</h3>
<p>Here is the code altogether for your copying and pasting pleasure. Enjoy!</p>
<pre><code>function get_attachment_icons($echo = false){
	$sAttachmentString = "&lt;div class='documentIconsWrapper'&gt; \n";
	if ( $files = get_children(array(   //do only if there are attachments of these qualifications
	 'post_parent' =&gt; get_the_ID(),
	 'post_type' =&gt; 'attachment',
	 'numberposts' =&gt; -1,
	 'post_mime_type' =&gt; 'application/pdf',  //MIME Type condition
	 ))){
	 foreach( $files as $file ){ //setup array for more than one file attachment
		$file_link = wp_get_attachment_url($file-&gt;ID);    //get the url for linkage
		$file_name_array=explode("/",$file_link);
		$file_name=array_reverse($file_name_array);  //creates an array out of the url and grabs the filename
		$sAttachmentString .= "&lt;div class='documentIcons'&gt;";
		$sAttachmentString .= "&lt;a href='$file_link'&gt;";
		$sAttachmentString .= "&lt;img src='".get_bloginfo('template_directory')."/images/mime/pdf.png'/&gt;";
		$sAttachmentString .= "&lt;/a&gt;";
		$sAttachmentString .= "&lt;br&gt;";
		$sAttachmentString .= "&lt;a href='$file_link'&gt;$file_name[0]&lt;/a&gt;";
		$sAttachmentString .= "&lt;/div&gt;";
		}
	}
	//Word Documents
	if ( $files = get_children(array(   //do only if there are attachments of these qualifications
	 'post_parent' =&gt; get_the_ID(),
	 'post_type' =&gt; 'attachment',
	 'numberposts' =&gt; -1,
	 'post_mime_type' =&gt; 'application/msword',  //MIME Type condition
	 ))){
	 foreach( $files as $file ){ //setup array for more than one file attachment
		$file_link = wp_get_attachment_url($file-&gt;ID);    //get the url for linkage
		$file_name_array=explode("/",$file_link);
		$file_name=array_reverse($file_name_array);  //creates an array out of the url and grabs the filename
		$sAttachmentString .= "&lt;div class='documentIcons'&gt;";
		$sAttachmentString .= "&lt;a href='$file_link'&gt;";
		$sAttachmentString .= "&lt;img src='".get_bloginfo('template_directory')."/images/mime/word.png'/&gt;";
		$sAttachmentString .= "&lt;/a&gt;";
		$sAttachmentString .= "&lt;br&gt;";
		$sAttachmentString .= "&lt;a href='$file_link'&gt;$file_name[0]&lt;/a&gt;";
		$sAttachmentString .= "&lt;/div&gt;";
		}
	}
	//Powerpoint Documents
	if ( $files = get_children(array(   //do only if there are attachments of these qualifications
	 'post_parent' =&gt; get_the_ID(),
	 'post_type' =&gt; 'attachment',
	 'numberposts' =&gt; -1,
	 'post_mime_type' =&gt; 'application/vnd.ms-powerpoint',  //MIME Type condition
	 ))){
	 foreach( $files as $file ){ //setup array for more than one file attachment
		$file_link = wp_get_attachment_url($file-&gt;ID);    //get the url for linkage
		$file_name_array=explode("/",$file_link);
		$file_name=array_reverse($file_name_array);  //creates an array out of the url and grabs the filename
		$sAttachmentString .= "&lt;div class='documentIcons'&gt;";
		$sAttachmentString .= "&lt;a href='$file_link'&gt;";
		$sAttachmentString .= "&lt;img src='".get_bloginfo('template_directory')."/images/mime/PowerPoint.png'/&gt;";
		$sAttachmentString .= "&lt;/a&gt;";
		$sAttachmentString .= "&lt;br&gt;";
		$sAttachmentString .= "&lt;a href='$file_link'&gt;$file_name[0]&lt;/a&gt;";
		$sAttachmentString .= "&lt;/div&gt;";
		}
	}
	//Excel Documents
	if ( $files = get_children(array(   //do only if there are attachments of these qualifications
	 'post_parent' =&gt; get_the_ID(),
	 'post_type' =&gt; 'attachment',
	 'numberposts' =&gt; -1,
	 'post_mime_type' =&gt; 'application/vnd.ms-excel',  //MIME Type condition
	 ))){
	 foreach( $files as $file ){ //setup array for more than one file attachment
		$file_link = wp_get_attachment_url($file-&gt;ID);    //get the url for linkage
		$file_name_array=explode("/",$file_link);
		$file_name=array_reverse($file_name_array);  //creates an array out of the url and grabs the filename
		$sAttachmentString .= "&lt;div class='documentIcons'&gt;";
		$sAttachmentString .= "&lt;a href='$file_link'&gt;";
		$sAttachmentString .= "&lt;img src='".get_bloginfo('template_directory')."/images/mime/XLS8.png'/&gt;";
		$sAttachmentString .= "&lt;/a&gt;";
		$sAttachmentString .= "&lt;br&gt;";
		$sAttachmentString .= "&lt;a href='$file_link'&gt;$file_name[0]&lt;/a&gt;";
		$sAttachmentString .= "&lt;/div&gt;";
		}
	}
	//Zipped Files
	if ( $files = get_children(array(   //do only if there are attachments of these qualifications
	 'post_parent' =&gt; get_the_ID(),
	 'post_type' =&gt; 'attachment',
	 'numberposts' =&gt; -1,
	 'post_mime_type' =&gt; 'application/zip',  //MIME Type condition
	 ))){
	 foreach( $files as $file ){ //setup array for more than one file attachment
		$file_link = wp_get_attachment_url($file-&gt;ID);    //get the url for linkage
		$file_name_array=explode("/",$file_link);
		$file_name=array_reverse($file_name_array);  //creates an array out of the url and grabs the filename
		$sAttachmentString .= "&lt;div class='documentIcons'&gt;";
		$sAttachmentString .= "&lt;a href='$file_link'&gt;";
		$sAttachmentString .= "&lt;img src='".get_bloginfo('template_directory')."/images/mime/zip.png'/&gt;";
		$sAttachmentString .= "&lt;/a&gt;";
		$sAttachmentString .= "&lt;br&gt;";
		$sAttachmentString .= "&lt;a href='$file_link'&gt;$file_name[0]&lt;/a&gt;";
		$sAttachmentString .= "&lt;/div&gt;";
		}
	}

	//Audio Files
	$mp3s = get_children(array(   //do only if there are attachments of these qualifications
	 'post_parent' =&gt; get_the_ID(),
	 'post_type' =&gt; 'attachment',
	 'numberposts' =&gt; -1,
	 'post_mime_type' =&gt; 'audio',  //MIME Type condition
	 ) );

	if (!empty($mp3s)) :
	$sAttachmentString .= "&lt;ul class='audiofiles'&gt;";
		foreach($mp3s as $mp3) :
    		$sAttachmentString .= "&lt;li&gt;";
			if(!empty($mp3-&gt;post_title)) : //checking to make sure the post title isn't empty
				$sAttachmentString .= "&lt;h4 class='title'&gt;".$mp3-&gt;post_title."&lt;/h4&gt;";
			endif;

			if(!empty($mp3-&gt;post_content)) : //checking to make sure something exists in post_content (description)
				$sAttachmentString .= "&lt;p class='description'&gt;".$mp3-&gt;post_content."&lt;/p&gt;";
			endif;

			$sAttachmentString .= "&lt;object width='470' height='24' id='single".$mp3-&gt;ID."' name='single".$mp3-&gt;ID."'&gt;";
				$sAttachmentString .= "&lt;param name='movie' value='player.swf'&gt;";
				$sAttachmentString .= "&lt;param name='allowfullscreen' value='true'&gt;";
				$sAttachmentString .= "&lt;param name='allowscriptaccess' value='always'&gt;";
				$sAttachmentString .= "&lt;param name='wmode' value='transparent'&gt;";
				$sAttachmentString .= "&lt;param name='flashvars' value='file=".$mp3-&gt;guid."'&gt;";
					$sAttachmentString .= "&lt;embed ";
					  $sAttachmentString .= "id='single".$mp3-&gt;ID."' ";
					  $sAttachmentString .= "name='single".$mp3-&gt;ID."' ";
					  $sAttachmentString .= "src='".get_bloginfo('template_directory')."/jw/player.swf' ";
					  $sAttachmentString .= "width='470' ";
					  $sAttachmentString .= "height='24' ";
					  $sAttachmentString .= "bgcolor='#ffffff' ";
					  $sAttachmentString .= "allowscriptaccess='always' ";
					  $sAttachmentString .= "allowfullscreen='true' ";
					  $sAttachmentString .= "flashvars='file=".$mp3-&gt;guid."' ";

					$sAttachmentString .= "/&gt;";
			$sAttachmentString .= "&lt;/object&gt;";
                        $sAttachmentString .= "&lt;a href='".$mp3-&gt;guid."'&gt;Download&lt;/a&gt;";
			$sAttachmentString .= "&lt;/li&gt;";
		endforeach;
	$sAttachmentString .= "&lt;/ul&gt;";
	endif;
$sAttachmentString .= "&lt;/div&gt;";
if($echo){
    echo $sAttachmentString;
  }
  return $sAttachmentString;
}
add_shortcode('attachment icons', 'get_attachment_icons');</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://tgrayimages.com/automate-file-attachments-on-your-wordpress-posts/feed/</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
		<item>
		<title>Ways to debug your jQuery or J&#8230;</title>
		<link>http://tgrayimages.com/ways-to-debug-your-jquery-or-j/</link>
		<comments>http://tgrayimages.com/ways-to-debug-your-jquery-or-j/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 18:55:28 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tweets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tgrayimages.com/ways-to-debug-your-jquery-or-j/</guid>
		<description><![CDATA[Ways to debug your jQuery or JavaScript code http://icio.us/tqq11s
]]></description>
			<content:encoded><![CDATA[<p>Ways to debug your jQuery or JavaScript code <a href="http://icio.us/tqq11s" rel="nofollow">http://icio.us/tqq11s</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tgrayimages.com/ways-to-debug-your-jquery-or-j/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>20 jQuery Plugins and Tutorial&#8230;</title>
		<link>http://tgrayimages.com/20-jquery-plugins-and-tutorial/</link>
		<comments>http://tgrayimages.com/20-jquery-plugins-and-tutorial/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 18:51:52 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tweets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tgrayimages.com/20-jquery-plugins-and-tutorial/</guid>
		<description><![CDATA[20 jQuery Plugins and Tutorials to Enhance Forms http://bit.ly/3YIIig
]]></description>
			<content:encoded><![CDATA[<p>20 jQuery Plugins and Tutorials to Enhance Forms <a href="http://bit.ly/3YIIig" rel="nofollow">http://bit.ly/3YIIig</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tgrayimages.com/20-jquery-plugins-and-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Holden&#8217;s BMW 328i: Lucky Boy :&#8230;</title>
		<link>http://tgrayimages.com/holdens-bmw-328i-lucky-boy/</link>
		<comments>http://tgrayimages.com/holdens-bmw-328i-lucky-boy/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 00:24:32 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tweets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tgrayimages.com/holdens-bmw-328i-lucky-boy/</guid>
		<description><![CDATA[Holden&#8217;s BMW 328i: Lucky Boy   http://flic.kr/p/6RTt9a
]]></description>
			<content:encoded><![CDATA[<p>Holden&#8217;s BMW 328i: Lucky Boy <img src='http://tgrayimages.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <a href="http://flic.kr/p/6RTt9a" rel="nofollow">http://flic.kr/p/6RTt9a</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tgrayimages.com/holdens-bmw-328i-lucky-boy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Anybody noticing that the Gmai&#8230;</title>
		<link>http://tgrayimages.com/anybody-noticing-that-the-gmai/</link>
		<comments>http://tgrayimages.com/anybody-noticing-that-the-gmai/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 18:36:12 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tweets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tgrayimages.com/anybody-noticing-that-the-gmai/</guid>
		<description><![CDATA[Anybody noticing that the Gmail spam filter seems to be broken today?
]]></description>
			<content:encoded><![CDATA[<p>Anybody noticing that the Gmail spam filter seems to be broken today?</p>
]]></content:encoded>
			<wfw:commentRss>http://tgrayimages.com/anybody-noticing-that-the-gmai/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nowhere in Lake Buena Vista, F&#8230;</title>
		<link>http://tgrayimages.com/nowhere-in-lake-buena-vista-f/</link>
		<comments>http://tgrayimages.com/nowhere-in-lake-buena-vista-f/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 01:21:57 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tweets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tgrayimages.com/nowhere-in-lake-buena-vista-f/</guid>
		<description><![CDATA[Nowhere in Lake Buena Vista, FL http://loopt.us/5dgmlA.t
]]></description>
			<content:encoded><![CDATA[<p>Nowhere in Lake Buena Vista, FL <a href="http://loopt.us/5dgmlA.t" rel="nofollow">http://loopt.us/5dgmlA.t</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tgrayimages.com/nowhere-in-lake-buena-vista-f/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Downtown Disney in Lake Buena &#8230;</title>
		<link>http://tgrayimages.com/downtown-disney-in-lake-buena/</link>
		<comments>http://tgrayimages.com/downtown-disney-in-lake-buena/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 00:13:45 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tweets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tgrayimages.com/downtown-disney-in-lake-buena/</guid>
		<description><![CDATA[Downtown Disney in Lake Buena Vista, FL http://loopt.us/hw4G0g.t
]]></description>
			<content:encoded><![CDATA[<p>Downtown Disney in Lake Buena Vista, FL <a href="http://loopt.us/hw4G0g.t" rel="nofollow">http://loopt.us/hw4G0g.t</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tgrayimages.com/downtown-disney-in-lake-buena/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>20k people that need to reappl&#8230;</title>
		<link>http://tgrayimages.com/20k-people-that-need-to-reappl/</link>
		<comments>http://tgrayimages.com/20k-people-that-need-to-reappl/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 00:11:26 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tweets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tgrayimages.com/20k-people-that-need-to-reappl/</guid>
		<description><![CDATA[20k people that need to reapply deodorant.
Fantasmic: http://flic.kr/p/6Fo9bR
]]></description>
			<content:encoded><![CDATA[<p>20k people that need to reapply deodorant.<br />
Fantasmic: <a href="http://flic.kr/p/6Fo9bR" rel="nofollow">http://flic.kr/p/6Fo9bR</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tgrayimages.com/20k-people-that-need-to-reappl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fireworks are amazing here! ht&#8230;</title>
		<link>http://tgrayimages.com/fireworks-are-amazing-here-ht/</link>
		<comments>http://tgrayimages.com/fireworks-are-amazing-here-ht/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 03:37:42 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tweets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tgrayimages.com/fireworks-are-amazing-here-ht/</guid>
		<description><![CDATA[Fireworks are amazing here! http://twitpic.com/a735r
]]></description>
			<content:encoded><![CDATA[<p>Fireworks are amazing here! <a href="http://twitpic.com/a735r" rel="nofollow">http://twitpic.com/a735r</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tgrayimages.com/fireworks-are-amazing-here-ht/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deny Access to No Referrer Requests</title>
		<link>http://tgrayimages.com/deny-access-to-no-referrer-requests/</link>
		<comments>http://tgrayimages.com/deny-access-to-no-referrer-requests/#comments</comments>
		<pubDate>Thu, 01 Nov 2007 03:47:03 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Geeky]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tgrayimages.com/2007/10/31/deny-access-to-no-referrer-requests/</guid>
		<description><![CDATA[When your readers comment, the wp-comments-post.php file is accessed, does its thing, and creates the post. The user&#8217;s browser will send a &#8220;referral&#8221; line about this.
When a spam-bot comes in, it hits the file directly and usually does not leave a referrer. This allows for some nifty detection and action direct from the server. If [...]]]></description>
			<content:encoded><![CDATA[<p>When your readers comment, the wp-comments-post.php file is accessed, does its thing, and creates the post. The user&#8217;s browser will send a &#8220;referral&#8221; line about this.</p>
<p>When a spam-bot comes in, it hits the file directly and usually does not leave a referrer. This allows for some nifty detection and action direct from the server. If you are not familiar with Apache directives, then write the following in your root directory .htaccess file::</p>
<p><code>RewriteEngine On<br />
RewriteCond %{REQUEST_METHOD} POST<br />
RewriteCond %{REQUEST_URI} .wp-comments-post\.php*<br />
RewriteCond %{HTTP_REFERER} !.*yourdomain.com.* [OR]<br />
RewriteCond %{HTTP_USER_AGENT} ^$<br />
RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]</code></p>
<p>This will:</p>
<p>Detect when a POST is being made<br />
Check to see if the post is on wp-comments-post.php<br />
Check if the referrer is in your domain or if no referrer<br />
Send the spam-bot BACK to its originating server&#8217;s IP address.<br />
NOTE 1: In the 4th line, change yourdomain.com to your domain.xxx without the www or any prefix for that matter.<br />
NOTE 2: There is a slim chance that someone&#8217;s browser will not send the referral, but this is extremely rare.</p>
<p>This essentially deflects the spam-bot back on itself.</p>
<p>Taken from <a href="http://codex.wordpress.org/Combating_Comment_Spam/Denying_Access">WordPress Codex</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tgrayimages.com/deny-access-to-no-referrer-requests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

