Randomly loading an included file
-
I’ve been using the following code to a template file in my theme:
<?php include (TEMPLATEPATH . '/inc_customcode.php'); ?>
I wanted to load a file randomly (when the page loads) and as such tried the following (which doesn’t work):
<?php include (TEMPLATEPATH . '/inc_customcode_<?php echo(rand(1,2)); ?>.php'); ?>
Does anyone know how I can modify the code to do this?
Thanks in advance.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Randomly loading an included file’ is closed to new replies.