Plugin Directory

Random File

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

Download Version 1.6.2

Retrieve the name, path, or link to a randomly chosen file or files 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:
<?php echo c2c_random_file('/random'); ?>
  • 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"

Links: Plugin Homepage | Plugin Directory Page | Author Homepage

Author: coffee2code

Requires: 1.5 or higher
Compatible up to: 3.3.1
Last Updated: 2011-12-14 Downloads: 14,231

Average Rating

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

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

Log in to vote.

100,1,1
100,2,2
100,2,2 100,1,1
100,1,1
100,1,1
0,1,0
100,1,1