Does anyone has a plugin to show a random thumbnail image of a template in Homepage?
Does anyone has a plugin to show a random thumbnail image of a template in Homepage?
Actually what I mean is just a random template thumbnail image (screenshot.png) from wp-content/themes.
Something like List-All-Posts, but it's List-Random-Template screenshot.
If its only the screenshot you are after, this works.
Copy every theme screenshot to one folder, then use a normal random image-type plugin such as http://wordpress.org/extend/plugins/random-image-selector/
Hmm, tedious to rename all screenshots, though.
Try a recursive read/find/array_slice/echo on the themes dir, did something similar in php this week.
Here's some code I've added directly into an index.php to show one random screenshot.png from the themes dir.
Oop forgot array_slice and a shuffle if you ever wanted more than one
Great!
However, I am not able to put this at my sidebar. Any solution?
Wrap everything in functions {} and it'll fly in a sidebar. You can put any functions into your template functions.php and then call the output function in the sidebar.
Excellent! Thank you so much!