• Say I had a post or page that was called interesting stuff. Is there a way I can display all the images from a folder called interesting stuff? Changing the contents of the folder would change the photos being displayed on the post or page.

    I found this searching the web:
    <?php
    $files = glob(“images/*.*”);
    for ($i=1; $i<count($files); $i++)
    {
    $num = $files[$i];
    echo ‘<img src=”‘.$num.'” alt=”random image”>’.”  “;
    }
    ?>

    But I have never been able to get php code to run inside a post or page.

Viewing 1 replies (of 1 total)
  • You can’t use PHP in the editor. Why don’t you use NextGen Gallery? You would be able to create an album called Interesting Stuff and display it in your posts or pages. Or if you preferred, you could post single pictures or whole galleries.

    It’s an awesome plugin – little bit of a learning curve but still very nice.

Viewing 1 replies (of 1 total)
  • The topic ‘How do I display all the images in a folder?’ is closed to new replies.