Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Random Slogan Displayer Re: Random Slogan Displayer

#70749
john010117
Member

Try:

Code:
<?php
$f_contents 
file (“./slogans.txt”);
$line $f_contents[array_rand ($f_contents)];
print 
$line;
?>

or

Code:
<?php
$f_contents 
file (get_bloginfo(‘stylesheet_directory’) . “/slogans.txt”);
$line $f_contents[array_rand ($f_contents)];
print 
$line;
?>