- Joined
- Jul 21, 2004
- Messages
- 1,001
- Reaction score
- 1
Hope one of you PHP gurus can help me ...
In a WordPress theme, I want to change this code:
to something like
so a random image between 1 and 3 is displayed as thumbnail.
But my code doesn't work ... no image is displayed
Any idea how I should change it?
In a WordPress theme, I want to change this code:
Code:
<?php if ( function_exists( 'get_the_image' ) ) { get_the_image(array( 'default_size' => 'thumbnail', 'image_scan' => true, 'default_image' => get_bloginfo( 'template_url' ) . '/images/[color=#FF0000]default_thumbnail.png[/color]', 'width' => '100', 'image_class' => 'wp-post-image' )); } ?>
to something like
Code:
<?php if ( function_exists( 'get_the_image' ) ) { get_the_image(array( 'default_size' => 'thumbnail', 'image_scan' => true, 'default_image' => get_bloginfo( 'template_url' ) . '/images/[color=#FF0000]default_thumbnail_0<?php echo rand(1,3)?>.png[/color]', 'width' => '100', 'image_class' => 'wp-post-image' )); } ?>
But my code doesn't work ... no image is displayed
Any idea how I should change it?