brasofilo

slideshow-with-different-pictures-on-each-page

May 7th, 2012
86
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function makeImmagineGallery(){
  2.     global $post;
  3.  
  4.     // PRINT THE CONTENTS OF $post
  5.     echo 'POST:<br><pre>';
  6.     print_r($post);
  7.     echo '</pre>';
  8.  
  9.     $results = get_children( array(
  10.         'post_parent' => $post->ID,
  11.         'post_status' => 'inherit',
  12.         'post_type' => 'attachment',
  13.         'order' => 'ASC',
  14.         'orderby' => 'menu_order ID') );
  15.  
  16.     foreach ( $results as $image ) {
  17.  
  18.         // PRINT THE CONTENTS OF $image
  19.         echo 'IMAGE:<br><pre>';
  20.         print_r($image);
  21.         echo '</pre>';
  22.  
  23.         echo '<img src="' . $image->guid . '" alt="immagine" />' . "\r\n";
  24.     }
  25. }
RAW Paste Data