/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function custom_image_rotator() { echo '<div class="image_box">'; $images[$file]['url'] = THESIS_ROTATOR_FOLDER . '/' . $file; $image_path = THESIS_ROTATOR . '/' . $file; $images[$file]['width'] = $image_size[0]; $images[$file]['height'] = $image_size[1]; if (thesis_get_image_size_class($image_size[0], $image_size[1])) $images[$file]['class'] = 'class="' . thesis_get_image_size_class($image_size[0], $image_size[1]) . '" '; } } if ($images) $image_alt_tags = thesis_get_option('image_alt_tags'); $image_link_urls = thesis_get_option('image_link_urls'); if ($image_alt_tags[$random_image]) $images[$random_image]['alt'] = $image_alt_tags[$random_image]; else $images[$random_image]['alt'] = $random_image; $img = '<img ' . $images[$random_image]['class'] . 'src="' . $images[$random_image]['url'] . '" alt="' . $images[$random_image]['alt'] . '" />'; if ($image_link_urls[$random_image]) { $link_before = '<a href="' . $image_link_urls[$random_image] . '">'; $link_after = '</a>' . "\n"; } else $img .= "\n"; echo $link_before . $img . $link_after . '</div>'; } add_action('thesis_hook_after_multimedia_box', 'custom_image_rotator');