I am wanting to find out if the following is possible with PHP inside WordPress.
Basically if I have a directory in my site called \"promos\" that consists of 1 to
Assuming that all files in the promos directory are images:
If, however, there are files in the directory that are not images, you would need to check that before showing it. The while loop would need to change to something like:
while (false !== ($file = readdir($handle))) {
if ((strpos($file, ".jpg")) || (strpos($file, ".gif"))) {
echo "";
}
}