Advertisement
Guest User

Untitled

a guest
Jun 9th, 2011
523
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | None | 0 0
  1. $query = new WP_Query('category_name=foobar&post_status=publish&showposts=5');
  2. foreach($query->posts as $spost)
  3. {
  4.     $children =& get_children('post_type=attachment&post_mime_type=image&post_parent='.$spost->ID);
  5.     foreach($children as $child)
  6.     {
  7.         echo wp_get_attachment_thumb_url($child->ID);
  8.         echo wp_get_attachment_url($child->ID);
  9.         //etc...
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement