[wp-testers] I have a quick question

Paul paul at codehooligans.com
Sat Dec 20 16:30:39 GMT 2008


Paul,

There are a number of ways to get the post attachments.

 From wp-includes/media.php
	get_children( array('post_parent' => $id, 'post_status' => 'inherit',  
'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' =>  
$order, 'orderby' => $orderby) );

Also you can just call get_posts:

	get_posts('post_parent=$post- 
 >ID&post_type=attachment&orderby=title&order=ASC');

P-


On Dec 20, 2008, at 10:22 AM, Paul Robinson wrote:

> Ok so I'm developing a theme for 2.7 and I can't seem to find a  
> function
> that allows you to get the images attached to a post using the posts  
> ID. Is
> there a function pre-made to do this?
>
> Just to be clear I am looking for a function that you can give the  
> posts ID
> and it will provide the IDs and stuff for all the attachments on  
> that post.
>
> Paul.
> _______________________________________________
> wp-testers mailing list
> wp-testers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-testers

Paul
paul at codehooligans.com

The codehooligans.com office will be close Dec 24-26 to observe the  
Christmas Holiday. Will re-open Dec 29



More information about the wp-testers mailing list