<?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: Post image the easy peasy way</title>
	<atom:link href="http://wp-fun.co.uk/2009/01/08/post-image-the-easy-peasy-way/feed/" rel="self" type="application/rss+xml" />
	<link>http://wp-fun.co.uk/2009/01/08/post-image-the-easy-peasy-way/</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 05 Mar 2010 11:56:05 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Andrew Rickmann</title>
		<link>http://wp-fun.co.uk/2009/01/08/post-image-the-easy-peasy-way/comment-page-1/#comment-1257</link>
		<dc:creator>Andrew Rickmann</dc:creator>
		<pubDate>Tue, 13 Jan 2009 02:25:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.wp-fun.co.uk/?p=1065#comment-1257</guid>
		<description>That isn&#039;t part of the function but it is a very simply matter to add it in.</description>
		<content:encoded><![CDATA[<p>That isn&#39;t part of the function but it is a very simply matter to add it in.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Byers</title>
		<link>http://wp-fun.co.uk/2009/01/08/post-image-the-easy-peasy-way/comment-page-1/#comment-1256</link>
		<dc:creator>Josh Byers</dc:creator>
		<pubDate>Tue, 13 Jan 2009 01:23:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.wp-fun.co.uk/?p=1065#comment-1256</guid>
		<description>Great tutorial!  This helps me so much!&lt;br&gt;&lt;br&gt;Is it possible to call individual images attached to the post based on their sort order using this function?&lt;br&gt;&lt;br&gt;The code might look like this:&lt;br&gt;&lt;?php the_image(&#039;medium&#039;,&#039;post-image&#039;); ?&gt; Default, calls the image with the sort order of 0&lt;br&gt;&lt;?php the_image(&#039;medium&#039;,&#039;post-image&#039;,&#039;1&#039;); ?&gt; Calls the image with the sort order of 1&lt;br&gt;&lt;?php the_image(&#039;medium&#039;,&#039;post-image&#039;,&#039;2&#039;); ?&gt; Calls the image with the sort order of 2&lt;br&gt;&lt;br&gt;And so on...</description>
		<content:encoded><![CDATA[<p>Great tutorial!  This helps me so much!</p>
<p>Is it possible to call individual images attached to the post based on their sort order using this function?</p>
<p>The code might look like this:<br />&lt;?php the_image(&#39;medium&#39;,&#39;post-image&#39;); ?&gt; Default, calls the image with the sort order of 0<br />&lt;?php the_image(&#39;medium&#39;,&#39;post-image&#39;,&#39;1&#39;); ?&gt; Calls the image with the sort order of 1<br />&lt;?php the_image(&#39;medium&#39;,&#39;post-image&#39;,&#39;2&#39;); ?&gt; Calls the image with the sort order of 2</p>
<p>And so on&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tonygray216</title>
		<link>http://wp-fun.co.uk/2009/01/08/post-image-the-easy-peasy-way/comment-page-1/#comment-1255</link>
		<dc:creator>tonygray216</dc:creator>
		<pubDate>Sun, 11 Jan 2009 00:22:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.wp-fun.co.uk/?p=1065#comment-1255</guid>
		<description>Wow! That is great! You are da man...thanks for the quick turn around.</description>
		<content:encoded><![CDATA[<p>Wow! That is great! You are da man&#8230;thanks for the quick turn around.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Rickmann</title>
		<link>http://wp-fun.co.uk/2009/01/08/post-image-the-easy-peasy-way/comment-page-1/#comment-1254</link>
		<dc:creator>Andrew Rickmann</dc:creator>
		<pubDate>Sat, 10 Jan 2009 23:14:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.wp-fun.co.uk/?p=1065#comment-1254</guid>
		<description>Take a look at my next post Vivien. I have updated the function to do what you want: &lt;br&gt;&lt;a href=&quot;http://www.wp-fun.co.uk/2009/01/10/easy-peasy-images-suggestion-roundup/&quot; rel=&quot;nofollow&quot;&gt;http://www.wp-fun.co.uk/2009/01/10/easy-peasy-i...&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Take a look at my next post Vivien. I have updated the function to do what you want: <br /><a href="http://www.wp-fun.co.uk/2009/01/10/easy-peasy-images-suggestion-roundup/" rel="nofollow"></a><a href="http://www.wp-fun.co.uk/2009/01/10/easy-peasy-i.." rel="nofollow">http://www.wp-fun.co.uk/2009/01/10/easy-peasy-i..</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Rickmann</title>
		<link>http://wp-fun.co.uk/2009/01/08/post-image-the-easy-peasy-way/comment-page-1/#comment-1253</link>
		<dc:creator>Andrew Rickmann</dc:creator>
		<pubDate>Sat, 10 Jan 2009 23:11:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.wp-fun.co.uk/?p=1065#comment-1253</guid>
		<description>Tony, I have updated the code in my new post: &lt;a href=&quot;http://www.wp-fun.co.uk/2009/01/10/easy-peasy-images-suggestion-roundup/&quot; rel=&quot;nofollow&quot;&gt;http://www.wp-fun.co.uk/2009/01/10/easy-peasy-i...&lt;/a&gt;&lt;br&gt;&lt;br&gt;I don&#039;t know much about thickbox so I have implemented the default, just as you have, and got the same results.</description>
		<content:encoded><![CDATA[<p>Tony, I have updated the code in my new post: <a href="http://www.wp-fun.co.uk/2009/01/10/easy-peasy-images-suggestion-roundup/" rel="nofollow"></a><a href="http://www.wp-fun.co.uk/2009/01/10/easy-peasy-i.." rel="nofollow">http://www.wp-fun.co.uk/2009/01/10/easy-peasy-i..</a>.</p>
<p>I don&#39;t know much about thickbox so I have implemented the default, just as you have, and got the same results.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: inspirationbit</title>
		<link>http://wp-fun.co.uk/2009/01/08/post-image-the-easy-peasy-way/comment-page-1/#comment-1252</link>
		<dc:creator>inspirationbit</dc:creator>
		<pubDate>Sat, 10 Jan 2009 23:11:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.wp-fun.co.uk/?p=1065#comment-1252</guid>
		<description>Thanks, Andrew. So basically, you&#039;re saying that I should leave the things as is on my blog: use a custom field to display the featured image and make this image available in RSS with the hook?</description>
		<content:encoded><![CDATA[<p>Thanks, Andrew. So basically, you&#39;re saying that I should leave the things as is on my blog: use a custom field to display the featured image and make this image available in RSS with the hook?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony Gray</title>
		<link>http://wp-fun.co.uk/2009/01/08/post-image-the-easy-peasy-way/comment-page-1/#comment-1251</link>
		<dc:creator>Tony Gray</dc:creator>
		<pubDate>Sat, 10 Jan 2009 21:21:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.wp-fun.co.uk/?p=1065#comment-1251</guid>
		<description>great! I&#039;m looking forward to it. Maybe you will help me figure out why I&#039;m seeing the close image instead of the text. You can see what i&#039;ve done here. &lt;a href=&quot;http://blog.tgrayimages.com/&quot; rel=&quot;nofollow&quot;&gt;http://blog.tgrayimages.com/&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>great! I&#39;m looking forward to it. Maybe you will help me figure out why I&#39;m seeing the close image instead of the text. You can see what i&#39;ve done here. <a href="http://blog.tgrayimages.com/" rel="nofollow">http://blog.tgrayimages.com/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Rickmann</title>
		<link>http://wp-fun.co.uk/2009/01/08/post-image-the-easy-peasy-way/comment-page-1/#comment-1250</link>
		<dc:creator>Andrew Rickmann</dc:creator>
		<pubDate>Sat, 10 Jan 2009 14:38:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.wp-fun.co.uk/?p=1065#comment-1250</guid>
		<description>Hi Tony,&lt;br&gt;&lt;br&gt;There is another way to do it which would be more flexible. Look out for the follow up post where I roll up the suggestions and I will include it there.</description>
		<content:encoded><![CDATA[<p>Hi Tony,</p>
<p>There is another way to do it which would be more flexible. Look out for the follow up post where I roll up the suggestions and I will include it there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony Gray</title>
		<link>http://wp-fun.co.uk/2009/01/08/post-image-the-easy-peasy-way/comment-page-1/#comment-1249</link>
		<dc:creator>Tony Gray</dc:creator>
		<pubDate>Sat, 10 Jan 2009 11:17:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.wp-fun.co.uk/?p=1065#comment-1249</guid>
		<description>This will be one of the most useful tutorials in my toolbox. I can&#039;t tell you have much headache you have just saved me. I&#039;ve been trying to teach my clients how to post images using the custom fields it and freaks them out. This is AWESOME. I made a couple of additions to your function. I wanted to be able to click on the image and show the large image in the jquery thickbox. Here is the modified code and all seems to be working great! I enqueued jquery and thickobx and then modified the anchor tag. Let me know if there is a better way.&lt;br&gt;&lt;br&gt;Thanks for the code!&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;code&gt;&lt;br&gt;function tb_enqueue() {&lt;br&gt;    wp_enqueue_script(&#039;jquery&#039;);&lt;br&gt;    wp_enqueue_script(&#039;thickbox&#039;);&lt;br&gt;}&lt;br&gt;add_action(&#039;wp_head&#039;, &#039;tb_enqueue&#039;, 1);&lt;br&gt;&lt;br&gt;function the_image($size = &#039;medium&#039; , $class = &#039;&#039;){&lt;br&gt;	global $post;&lt;br&gt; &lt;br&gt;	//setup the attachment array&lt;br&gt;	$att_array = array(&lt;br&gt;		&#039;post_parent&#039; =&gt; $post-&gt;ID,&lt;br&gt;		&#039;post_type&#039; =&gt; &#039;attachment&#039;,&lt;br&gt;		&#039;post_mime_type&#039; =&gt; &#039;image&#039;,&lt;br&gt;		&#039;order_by&#039; =&gt; &#039;menu_order&#039;&lt;br&gt;	);&lt;br&gt; &lt;br&gt;	//get the post attachments&lt;br&gt;	$attachments = get_children($att_array);&lt;br&gt; &lt;br&gt;	//make sure there are attachments&lt;br&gt;	if (is_array($attachments)){&lt;br&gt;		//loop through them&lt;br&gt;		foreach($attachments as $att){&lt;br&gt;			//find the one we want based on its characteristics&lt;br&gt;			if ( $att-&gt;menu_order == 0){&lt;br&gt;				$image_src_array = wp_get_attachment_image_src($att-&gt;ID, $size);&lt;br&gt;				$image_src_array_large = wp_get_attachment_image_src($att-&gt;ID, &quot;large&quot;);&lt;br&gt; &lt;br&gt;				//get url - 1 and 2 are the x and y dimensions&lt;br&gt;				$url = $image_src_array[0];&lt;br&gt;				$url_large = $image_src_array_large[0];&lt;br&gt;				$caption = $att-&gt;post_excerpt;&lt;br&gt;				$image_html = &#039;&lt;a href=&quot;%s&quot; class=&quot;thickbox&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;%s&quot; alt=&quot;%s&quot; class=&quot;%s&quot; /&gt;&lt;/a&gt;&#039;;&lt;br&gt; &lt;br&gt;				//combine the data&lt;br&gt;				$html = sprintf($image_html,$url_large,$url,$caption,$class);&lt;br&gt; &lt;br&gt;				//echo the result&lt;br&gt;				echo $html;&lt;br&gt;			}&lt;br&gt;		}&lt;br&gt;	}&lt;br&gt;}&lt;br&gt;&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>This will be one of the most useful tutorials in my toolbox. I can&#39;t tell you have much headache you have just saved me. I&#39;ve been trying to teach my clients how to post images using the custom fields it and freaks them out. This is AWESOME. I made a couple of additions to your function. I wanted to be able to click on the image and show the large image in the jquery thickbox. Here is the modified code and all seems to be working great! I enqueued jquery and thickobx and then modified the anchor tag. Let me know if there is a better way.</p>
<p>Thanks for the code!</p>
<p><code><br />function tb_enqueue() {<br />    wp_enqueue_script(&#39;jquery&#39;);<br />    wp_enqueue_script(&#39;thickbox&#39;);<br />}<br />add_action(&#39;wp_head&#39;, &#39;tb_enqueue&#39;, 1);</p>
<p>function the_image($size = &#39;medium&#39; , $class = &#39;&#39;){<br />	global $post;</p>
<p>	//setup the attachment array<br />	$att_array = array(<br />		&#39;post_parent&#39; =&gt; $post-&gt;ID,<br />		&#39;post_type&#39; =&gt; &#39;attachment&#39;,<br />		&#39;post_mime_type&#39; =&gt; &#39;image&#39;,<br />		&#39;order_by&#39; =&gt; &#39;menu_order&#39;<br />	);</p>
<p>	//get the post attachments<br />	$attachments = get_children($att_array);</p>
<p>	//make sure there are attachments<br />	if (is_array($attachments)){<br />		//loop through them<br />		foreach($attachments as $att){<br />			//find the one we want based on its characteristics<br />			if ( $att-&gt;menu_order == 0){<br />				$image_src_array = wp_get_attachment_image_src($att-&gt;ID, $size);<br />				$image_src_array_large = wp_get_attachment_image_src($att-&gt;ID, "large");</p>
<p>				//get url - 1 and 2 are the x and y dimensions<br />				$url = $image_src_array[0];<br />				$url_large = $image_src_array_large[0];<br />				$caption = $att-&gt;post_excerpt;<br />				$image_html = &#39;<a href="%s" class="thickbox" rel="nofollow">&lt;img src="%s" alt="%s" class="%s" /&gt;</a>&#39;;</p>
<p>				//combine the data<br />				$html = sprintf($image_html,$url_large,$url,$caption,$class);</p>
<p>				//echo the result<br />				echo $html;<br />			}<br />		}<br />	}<br />}<br /></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Whitehouse</title>
		<link>http://wp-fun.co.uk/2009/01/08/post-image-the-easy-peasy-way/comment-page-1/#comment-1247</link>
		<dc:creator>Ben Whitehouse</dc:creator>
		<pubDate>Sat, 10 Jan 2009 00:23:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.wp-fun.co.uk/?p=1065#comment-1247</guid>
		<description>Thanks Andrew. I did a little dance and hacked something together that now works. Thanks!</description>
		<content:encoded><![CDATA[<p>Thanks Andrew. I did a little dance and hacked something together that now works. Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
