Adding Random Header Image
but instead of
using mt_rand(1, NUMBER-OF-IMAGES),
where you have to replace NUMBER-OF-IMAGES every time you add a new image.
I just have it count number of files in my directory like this
Code: Select all
'SITE_LOGO_RANDOM' => mt_rand(1, iterator_count(new FilesystemIterator("/home/bakon306/public_html/gimplearn/styles/prosilver/theme/images/custom_logos/", FilesystemIterator::SKIP_DOTS)) ), // change mt_rand(1, NUMBER-OF-IMAGES)
So that when i add images i don't have up change the functions.php file.