title: Display all images from a folder in a WordPress page
body: <p>I created a custom WordPress page template and I want to show all the pictures I created in a folder inside my template:  mypics.  I created this php script but is not working (it shows a broken link):</p>
  
  <pre><code>    $base_dir = bloginfo('template_url');
      $media_dir = $base_dir.'/mypics/';
  
      $files = glob($media_dir.'{*.jpg,*.png}', GLOB_BRACE);
      foreach ($files as $image){
         echo '&lt;img src="'.$media_dir.$image.'" /&gt;';
      };
  </code></pre>
  
  <p>I will appreciate any help!</p>