<?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: Get Images Attached to a Post</title>
	<atom:link href="http://www.rlmseo.com/blog/get-images-attached-to-post/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rlmseo.com/blog/get-images-attached-to-post/</link>
	<description></description>
	<lastBuildDate>Thu, 19 Jan 2012 17:05:16 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Wigid</title>
		<link>http://www.rlmseo.com/blog/get-images-attached-to-post/#comment-634</link>
		<dc:creator>Wigid</dc:creator>
		<pubDate>Fri, 13 Jan 2012 09:48:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.rlmseo.com/?p=320#comment-634</guid>
		<description>Hi Keith
nice solution you have, I also find other solution
just adding  
global $post, $posts; 
under the function name
example
function bdw_get_images() {
  global $post, $posts;

should be works</description>
		<content:encoded><![CDATA[<p>Hi Keith<br />
nice solution you have, I also find other solution<br />
just adding<br />
global $post, $posts;<br />
under the function name<br />
example<br />
function bdw_get_images() {<br />
  global $post, $posts;</p>
<p>should be works</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://www.rlmseo.com/blog/get-images-attached-to-post/#comment-302</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Thu, 22 Sep 2011 16:37:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.rlmseo.com/?p=320#comment-302</guid>
		<description>HI there. I just noticed that when I used the function inside a loop that the post ID was not getting set, so I used the &#039;out of loop&#039; method of setting it. It could be because I was calling it inside of a custom post type post? NOt sure if that ID would need to be called differently. Anyways everything works, and it was an easy fix. :) Thanks loads for a nice little snippet!</description>
		<content:encoded><![CDATA[<p>HI there. I just noticed that when I used the function inside a loop that the post ID was not getting set, so I used the &#8216;out of loop&#8217; method of setting it. It could be because I was calling it inside of a custom post type post? NOt sure if that ID would need to be called differently. Anyways everything works, and it was an easy fix. <img src='http://www.rlmseo.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Thanks loads for a nice little snippet!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://www.rlmseo.com/blog/get-images-attached-to-post/#comment-301</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Sat, 05 Mar 2011 21:23:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.rlmseo.com/?p=320#comment-301</guid>
		<description>Here&#039;s what I did, I wanted to have random images display on subpages below the header, sort of like a featured image, so I setup a post for it and uploaded all the photos I wanted to rotate and I modified the above function to show random images each time the page is loaded or refreshed instead of just showing the latest uploaded image. In this particular case I knew exactly what post I wanted to pull from so it worked well.

Let me know if anyone sees any reason why this may not be a good way to do it.

//Get Post Images
function bdw_get_images() {
 
    // Get the post ID
    $iPostID = 133;
 
    // Get images for this post
    $arrImages =&amp; get_children(&#039;post_type=attachment&amp;post_mime_type=image&amp;post_parent=&#039; . $iPostID );
 
    // If images exist for this page
    if($arrImages) {
 
        // Get the first image attachment
		$iNum = array_rand($arrImages,1);
 
        // Get the full size url for the attachment
        $sImageUrl = wp_get_attachment_url($iNum);
 
        // Build the  string
        $sImgString = &#039;&#039;;
 
        // Print the image
        echo $sImgString;
    }
}</description>
		<content:encoded><![CDATA[<p>Here&#8217;s what I did, I wanted to have random images display on subpages below the header, sort of like a featured image, so I setup a post for it and uploaded all the photos I wanted to rotate and I modified the above function to show random images each time the page is loaded or refreshed instead of just showing the latest uploaded image. In this particular case I knew exactly what post I wanted to pull from so it worked well.</p>
<p>Let me know if anyone sees any reason why this may not be a good way to do it.</p>
<p>//Get Post Images<br />
function bdw_get_images() {</p>
<p>    // Get the post ID<br />
    $iPostID = 133;</p>
<p>    // Get images for this post<br />
    $arrImages =&amp; get_children(&#8216;post_type=attachment&amp;post_mime_type=image&amp;post_parent=&#8217; . $iPostID );</p>
<p>    // If images exist for this page<br />
    if($arrImages) {</p>
<p>        // Get the first image attachment<br />
		$iNum = array_rand($arrImages,1);</p>
<p>        // Get the full size url for the attachment<br />
        $sImageUrl = wp_get_attachment_url($iNum);</p>
<p>        // Build the  string<br />
        $sImgString = &#8221;;</p>
<p>        // Print the image<br />
        echo $sImgString;<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://www.rlmseo.com/blog/get-images-attached-to-post/#comment-300</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Sat, 05 Mar 2011 20:51:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.rlmseo.com/?p=320#comment-300</guid>
		<description>What if we wanted to randomly display an image from the group of images attached to the post?</description>
		<content:encoded><![CDATA[<p>What if we wanted to randomly display an image from the group of images attached to the post?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Garry</title>
		<link>http://www.rlmseo.com/blog/get-images-attached-to-post/#comment-299</link>
		<dc:creator>Garry</dc:creator>
		<pubDate>Wed, 23 Feb 2011 13:01:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.rlmseo.com/?p=320#comment-299</guid>
		<description>I appear to copy/pasted over the first part of the code!!

-------------------------------------------------------------


 
	
 
	post_date);
	$month = mysql2date(‘n’, $post-&gt;post_date);

------------------------------------------------------</description>
		<content:encoded><![CDATA[<p>I appear to copy/pasted over the first part of the code!!</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>	post_date);<br />
	$month = mysql2date(‘n’, $post-&gt;post_date);</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Garry</title>
		<link>http://www.rlmseo.com/blog/get-images-attached-to-post/#comment-298</link>
		<dc:creator>Garry</dc:creator>
		<pubDate>Wed, 23 Feb 2011 12:57:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.rlmseo.com/?p=320#comment-298</guid>
		<description>Wonderful - many thanks! I have been looking for a way to get all of my images uploaded and assigned to posts to show on a single page - as a pictorial &quot;archive&quot;, listed by month.

Using this, and another code snippet I found elsewhere, I&#039;ve got the result I wanted: http://www.my105e.com/pictures

---------------------------------------------------------------


 
	
 
	post_date);
	$month = mysql2date(&#039;n&#039;, $post-&gt;post_date);
	$day = mysql2date(&#039;j&#039;, $post-&gt;post_date);
	$postid = $post-&gt;ID;
	
	?&gt;
 
	
 
		
		
		
 
		&lt;a href=&quot;/date/&quot;&gt;&lt;/a&gt;
 
		
 
		
 
	
 
	
 
	
	

	


ID;
 
    // Get images for this post
    $arrImages =&amp; get_children(&#039;post_type=attachment&amp;post_mime_type=image&amp;post_parent=&#039; . $iPostID );
 
    // If images exist for this page
    if($arrImages) {
 
        // Get array keys representing attached image numbers
        $arrKeys = array_keys($arrImages);
 
        //******BEGIN BUBBLE SORT BY MENU ORDER************
        // Put all image objects into new array with standard numeric keys (new array only needed while we sort the keys)
        foreach($arrImages as $oImage) {
            $arrNewImages[] = $oImage;
        }
 
        // Bubble sort image object array by menu_order TODO: Turn this into std &quot;sort-by&quot; function in functions.php
        for($i = 0; $i &lt; sizeof($arrNewImages) - 1; $i++) {
            for($j = 0; $j menu_order &gt; (int)$arrNewImages[$j + 1]-&gt;menu_order) {
                    $oTemp = $arrNewImages[$j];
                    $arrNewImages[$j] = $arrNewImages[$j + 1];
                    $arrNewImages[$j + 1] = $oTemp;
                }
            }
        }
 
        // Reset arrKeys array
        $arrKeys = array();
 
        // Replace arrKeys with newly sorted object ids
        foreach($arrNewImages as $oNewImage) {
            $arrKeys[] = $oNewImage-&gt;ID;
        }
        //******END BUBBLE SORT BY MENU ORDER**************/
		
		foreach ($arrKeys as $iNum) {
			// Get the first image attachment
			//$iNum = $arrKeys[0];
	 
			// Get the thumbnail url for the attachment
			$sThumbUrl = wp_get_attachment_thumb_url($iNum);
	 
			// UNCOMMENT THIS IF YOU WANT THE FULL SIZE IMAGE INSTEAD OF THE THUMBNAIL
			//$sImageUrl = wp_get_attachment_url($iNum);
	 
			// Build the  string
			$sImgString = &#039;&lt;a href=&quot;&#039; . get_permalink() . &#039;&quot; rel=&quot;nofollow&quot;&gt;&#039; .
								&#039;&#039; .
							&#039;&lt;/a&gt; &#039;;
	 
			// Print the image
			echo $sImgString;
		}
    }
}
?&gt;
---------------------------------------------------------------</description>
		<content:encoded><![CDATA[<p>Wonderful &#8211; many thanks! I have been looking for a way to get all of my images uploaded and assigned to posts to show on a single page &#8211; as a pictorial &#8220;archive&#8221;, listed by month.</p>
<p>Using this, and another code snippet I found elsewhere, I&#8217;ve got the result I wanted: <a href="http://www.my105e.com/pictures" rel="nofollow">http://www.my105e.com/pictures</a></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>	post_date);<br />
	$month = mysql2date(&#8216;n&#8217;, $post-&gt;post_date);<br />
	$day = mysql2date(&#8216;j&#8217;, $post-&gt;post_date);<br />
	$postid = $post-&gt;ID;</p>
<p>	?&gt;</p>
<p>		&lt;a href=&quot;/date/&#8221;&gt;</p>
<p>ID;</p>
<p>    // Get images for this post<br />
    $arrImages =&amp; get_children(&#8216;post_type=attachment&amp;post_mime_type=image&amp;post_parent=&#8217; . $iPostID );</p>
<p>    // If images exist for this page<br />
    if($arrImages) {</p>
<p>        // Get array keys representing attached image numbers<br />
        $arrKeys = array_keys($arrImages);</p>
<p>        //******BEGIN BUBBLE SORT BY MENU ORDER************<br />
        // Put all image objects into new array with standard numeric keys (new array only needed while we sort the keys)<br />
        foreach($arrImages as $oImage) {<br />
            $arrNewImages[] = $oImage;<br />
        }</p>
<p>        // Bubble sort image object array by menu_order TODO: Turn this into std &#8220;sort-by&#8221; function in functions.php<br />
        for($i = 0; $i &lt; sizeof($arrNewImages) &#8211; 1; $i++) {<br />
            for($j = 0; $j menu_order &gt; (int)$arrNewImages[$j + 1]-&gt;menu_order) {<br />
                    $oTemp = $arrNewImages[$j];<br />
                    $arrNewImages[$j] = $arrNewImages[$j + 1];<br />
                    $arrNewImages[$j + 1] = $oTemp;<br />
                }<br />
            }<br />
        }</p>
<p>        // Reset arrKeys array<br />
        $arrKeys = array();</p>
<p>        // Replace arrKeys with newly sorted object ids<br />
        foreach($arrNewImages as $oNewImage) {<br />
            $arrKeys[] = $oNewImage-&gt;ID;<br />
        }<br />
        //******END BUBBLE SORT BY MENU ORDER**************/</p>
<p>		foreach ($arrKeys as $iNum) {<br />
			// Get the first image attachment<br />
			//$iNum = $arrKeys[0];</p>
<p>			// Get the thumbnail url for the attachment<br />
			$sThumbUrl = wp_get_attachment_thumb_url($iNum);</p>
<p>			// UNCOMMENT THIS IF YOU WANT THE FULL SIZE IMAGE INSTEAD OF THE THUMBNAIL<br />
			//$sImageUrl = wp_get_attachment_url($iNum);</p>
<p>			// Build the  string<br />
			$sImgString = &#8216;<a href="' . get_permalink() . '" rel="nofollow">&#8216; .<br />
								&#8221; .<br />
							&#8216;</a> &#8216;;</p>
<p>			// Print the image<br />
			echo $sImgString;<br />
		}<br />
    }<br />
}<br />
?&gt;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wan</title>
		<link>http://www.rlmseo.com/blog/get-images-attached-to-post/#comment-297</link>
		<dc:creator>wan</dc:creator>
		<pubDate>Sat, 08 Jan 2011 05:54:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.rlmseo.com/?p=320#comment-297</guid>
		<description>Sorted i just put :  $sImgString =  &#039;  &#039;;</description>
		<content:encoded><![CDATA[<p>Sorted i just put :  $sImgString =  &#8216;  &#8216;;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wan</title>
		<link>http://www.rlmseo.com/blog/get-images-attached-to-post/#comment-296</link>
		<dc:creator>wan</dc:creator>
		<pubDate>Sat, 08 Jan 2011 04:13:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.rlmseo.com/?p=320#comment-296</guid>
		<description>It works all images displayed. Can you help me how can i display them in a list? i want to combine them in jquery slider unfortunate cant get around that.

thx</description>
		<content:encoded><![CDATA[<p>It works all images displayed. Can you help me how can i display them in a list? i want to combine them in jquery slider unfortunate cant get around that.</p>
<p>thx</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Crenshaw</title>
		<link>http://www.rlmseo.com/blog/get-images-attached-to-post/#comment-295</link>
		<dc:creator>John Crenshaw</dc:creator>
		<pubDate>Wed, 22 Dec 2010 19:57:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.rlmseo.com/?p=320#comment-295</guid>
		<description>Have you tried this suggestion: http://www.rlmseo.com/blog/get-images-attached-to-post/comment-page-1/#comment-1695</description>
		<content:encoded><![CDATA[<p>Have you tried this suggestion: <a href="http://www.rlmseo.com/blog/get-images-attached-to-post/comment-page-1/#comment-1695" rel="nofollow">http://www.rlmseo.com/blog/get-images-attached-to-post/comment-page-1/#comment-1695</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Crenshaw</title>
		<link>http://www.rlmseo.com/blog/get-images-attached-to-post/#comment-294</link>
		<dc:creator>John Crenshaw</dc:creator>
		<pubDate>Wed, 22 Dec 2010 19:53:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.rlmseo.com/?p=320#comment-294</guid>
		<description>Yeah, I&#039;ve been meaning to update this post with that info. Not sure what I was thinking with that sorting method, but you beat me to it...thanks for the tip!</description>
		<content:encoded><![CDATA[<p>Yeah, I&#8217;ve been meaning to update this post with that info. Not sure what I was thinking with that sorting method, but you beat me to it&#8230;thanks for the tip!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leandro</title>
		<link>http://www.rlmseo.com/blog/get-images-attached-to-post/#comment-293</link>
		<dc:creator>Leandro</dc:creator>
		<pubDate>Mon, 20 Dec 2010 17:10:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.rlmseo.com/?p=320#comment-293</guid>
		<description>Actually, I&#039;m getting all the images in library and not just for the actual post. Any Idea?


Code:

function bdw_get_images() {

    // Get the post ID
   $iPostID = get_the_ID();
   
    // Get images for this post
    $arrImages =&amp; get_children(&#039;post_type=attachment&amp;post_mime_type=image&amp;post_parent=&#039; . $iPostID );

    // If images exist for this page
    if($arrImages) {

        // Get array keys representing attached image numbers
       $arrKeys = array_keys($arrImages);

    /******BEGIN BUBBLE SORT BY MENU ORDER************
    // Put all image objects into new array with standard numeric keys (new array only needed while we sort the keys)
    foreach($arrImages as $oImage) {
      $arrNewImages[] = $oImage;
    }

    // Bubble sort image object array by menu_order TODO: Turn this into std &quot;sort-by&quot; function in functions.php
    for($i = 0; $i &lt; sizeof($arrNewImages) - 1; $i++) {
      for($j = 0; $j menu_order &gt; (int)$arrNewImages[$j + 1]-&gt;menu_order) {
          $oTemp = $arrNewImages[$j];
          $arrNewImages[$j] = $arrNewImages[$j + 1];
          $arrNewImages[$j + 1] = $oTemp;
        }
      }
    }

    // Reset arrKeys array
    $arrKeys = array();

    // Replace arrKeys with newly sorted object ids
    foreach($arrNewImages as $oNewImage) {
      $arrKeys[] = $oNewImage-&gt;ID;
    }
    ******END BUBBLE SORT BY MENU ORDER**************/

        // Get the first image attachment
        //$iNum = $arrKeys[0];
        
        foreach ($arrKeys as $iNum) {

        // Get the thumbnail url for the attachment
        $sThumbUrl = wp_get_attachment_url($iNum);

        // UNCOMMENT THIS IF YOU WANT THE FULL SIZE IMAGE INSTEAD OF THE THUMBNAIL
        //$sImageUrl = wp_get_attachment_url($iNum);

        // Build the  string
        $sImgString = &#039;
          
        &#039;;

        // Print the image
        echo $sImgString;
        }
  }
}</description>
		<content:encoded><![CDATA[<p>Actually, I&#8217;m getting all the images in library and not just for the actual post. Any Idea?</p>
<p>Code:</p>
<p>function bdw_get_images() {</p>
<p>    // Get the post ID<br />
   $iPostID = get_the_ID();</p>
<p>    // Get images for this post<br />
    $arrImages =&amp; get_children(&#8216;post_type=attachment&amp;post_mime_type=image&amp;post_parent=&#8217; . $iPostID );</p>
<p>    // If images exist for this page<br />
    if($arrImages) {</p>
<p>        // Get array keys representing attached image numbers<br />
       $arrKeys = array_keys($arrImages);</p>
<p>    /******BEGIN BUBBLE SORT BY MENU ORDER************<br />
    // Put all image objects into new array with standard numeric keys (new array only needed while we sort the keys)<br />
    foreach($arrImages as $oImage) {<br />
      $arrNewImages[] = $oImage;<br />
    }</p>
<p>    // Bubble sort image object array by menu_order TODO: Turn this into std &#8220;sort-by&#8221; function in functions.php<br />
    for($i = 0; $i &lt; sizeof($arrNewImages) &#8211; 1; $i++) {<br />
      for($j = 0; $j menu_order &gt; (int)$arrNewImages[$j + 1]-&gt;menu_order) {<br />
          $oTemp = $arrNewImages[$j];<br />
          $arrNewImages[$j] = $arrNewImages[$j + 1];<br />
          $arrNewImages[$j + 1] = $oTemp;<br />
        }<br />
      }<br />
    }</p>
<p>    // Reset arrKeys array<br />
    $arrKeys = array();</p>
<p>    // Replace arrKeys with newly sorted object ids<br />
    foreach($arrNewImages as $oNewImage) {<br />
      $arrKeys[] = $oNewImage-&gt;ID;<br />
    }<br />
    ******END BUBBLE SORT BY MENU ORDER**************/</p>
<p>        // Get the first image attachment<br />
        //$iNum = $arrKeys[0];</p>
<p>        foreach ($arrKeys as $iNum) {</p>
<p>        // Get the thumbnail url for the attachment<br />
        $sThumbUrl = wp_get_attachment_url($iNum);</p>
<p>        // UNCOMMENT THIS IF YOU WANT THE FULL SIZE IMAGE INSTEAD OF THE THUMBNAIL<br />
        //$sImageUrl = wp_get_attachment_url($iNum);</p>
<p>        // Build the  string<br />
        $sImgString = &#8216;</p>
<p>        &#8216;;</p>
<p>        // Print the image<br />
        echo $sImgString;<br />
        }<br />
  }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: realmC</title>
		<link>http://www.rlmseo.com/blog/get-images-attached-to-post/#comment-292</link>
		<dc:creator>realmC</dc:creator>
		<pubDate>Mon, 20 Dec 2010 16:23:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.rlmseo.com/?p=320#comment-292</guid>
		<description>excuse the double post, but i just wanted to suggest another sorting method - even easier:
get_post() supports an &#039;order_by&#039; argument; so using the query with &#039;order_by=menu_order&amp;order=DESC&#039; should give you the same result as your code</description>
		<content:encoded><![CDATA[<p>excuse the double post, but i just wanted to suggest another sorting method &#8211; even easier:<br />
get_post() supports an &#8216;order_by&#8217; argument; so using the query with &#8216;order_by=menu_order&amp;order=DESC&#8217; should give you the same result as your code</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: realmC</title>
		<link>http://www.rlmseo.com/blog/get-images-attached-to-post/#comment-291</link>
		<dc:creator>realmC</dc:creator>
		<pubDate>Mon, 20 Dec 2010 14:14:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.rlmseo.com/?p=320#comment-291</guid>
		<description>hey, thanks! really helpful!

just one thing: i was looking for a better way to do the sorting by menu_order and came up with this:

foreach( $images as $image )
    $imglist[$image-&gt;menu_order] = $image-&gt;ID;

    ksort( $imglist );

works well for me and is easier</description>
		<content:encoded><![CDATA[<p>hey, thanks! really helpful!</p>
<p>just one thing: i was looking for a better way to do the sorting by menu_order and came up with this:</p>
<p>foreach( $images as $image )<br />
    $imglist[$image-&gt;menu_order] = $image-&gt;ID;</p>
<p>    ksort( $imglist );</p>
<p>works well for me and is easier</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: san</title>
		<link>http://www.rlmseo.com/blog/get-images-attached-to-post/#comment-290</link>
		<dc:creator>san</dc:creator>
		<pubDate>Thu, 09 Dec 2010 20:05:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.rlmseo.com/?p=320#comment-290</guid>
		<description>i am not able to get all the images related to that post only getting one image.can anyone please tell.
Thank you</description>
		<content:encoded><![CDATA[<p>i am not able to get all the images related to that post only getting one image.can anyone please tell.<br />
Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony Blade</title>
		<link>http://www.rlmseo.com/blog/get-images-attached-to-post/#comment-289</link>
		<dc:creator>Tony Blade</dc:creator>
		<pubDate>Tue, 09 Nov 2010 00:49:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.rlmseo.com/?p=320#comment-289</guid>
		<description> &#039;attachment&#039;,
	&#039;numberposts&#039; =&gt; 40,
	&#039;post_status&#039; =&gt; null,
	&#039;post_parent&#039; =&gt; 19
);
?&gt;

	
	ID, $size=&#039;thumbnail&#039;, $icon = false);
	?&gt;
	
    

this is what worked for me, &#039;numberposts&#039; sets the maximum number of images You want to display and post_parent You can replace with post-&gt;$ID to display the images related to current post. I wanted to have a static list of images which were attached to a page.

Hope You find this useful
Cheers</description>
		<content:encoded><![CDATA[<p>&#8216;attachment&#8217;,<br />
	&#8216;numberposts&#8217; =&gt; 40,<br />
	&#8216;post_status&#8217; =&gt; null,<br />
	&#8216;post_parent&#8217; =&gt; 19<br />
);<br />
?&gt;</p>
<p>	ID, $size=&#8217;thumbnail&#8217;, $icon = false);<br />
	?&gt;</p>
<p>this is what worked for me, &#8216;numberposts&#8217; sets the maximum number of images You want to display and post_parent You can replace with post-&gt;$ID to display the images related to current post. I wanted to have a static list of images which were attached to a page.</p>
<p>Hope You find this useful<br />
Cheers</p>
]]></content:encoded>
	</item>
</channel>
</rss>

