Plugin Directory

Random File

Author: Scott Reilly

Retrieve the name, path, or link to a randomly chosen file in a specified directory.

Useful for displaying random images/logos or including text from random files onto your site (writing excerpts, multi-line quotes, etc).

Notes:

  • If you want to actually display the name of the random file, be sure to 'echo' the results:

  • Unless you limit the file search to only include a particular extension (via $extensions argument), all files in the specified $dir will be under consideration for random selection

  • Can be run inside or outside of "the loop."

Download

FYI

Compatibility beta

Your Setup

Log in to vote.

The Consensus

No data

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(0 ratings)