title of the image in a random image format

yvidal / 2012-07-21 12:22:33   

can not see the title of the image in a random image format.
yoramvidal.com

arsondpi / 2012-07-21 13:17:38   

edit the random image plugin, find line 45 and replace it with:

$s .= "<img src='" . $OBJ->vars->images[0][$rand]['media_path'] . "' /><p class='random_img_title'>" . $OBJ->vars->images[0][$rand]['media_title'] . "</p>";

then in your style.css add a css rule for the title
.random_img_title { ... }

yvidal / 2012-07-21 14:11:12   

thanks, now it is working

drhyt / 2012-10-28 19:00:01   

Thanks, arsondpi, but now I'm wondering: How to get the caption also to show up?

drhyt / 2012-10-28 22:18:42   

Also, to make the code validate on W3C I had to add alt='' to it, i.e.

  1. $s .= "<img src='" . $OBJ->vars->images[0][$rand]['media_path'] . "' alt='' /><p class='random_img_title'>" . $OBJ->vars->images[0][$rand]['media_title'] . "</p>";
matthewsstuart / 2012-12-21 22:43:11   

Hi Yvidal and Arsondpi,

I've done the code for the random image plugin although not sure what I need to put in the CSS Style page. Please can you advise?

Thanks

Stuart

stuartmatthews.eu

arsondpi / 2012-12-21 23:24:51   

The css class is .random_img_title

matthewsstuart / 2012-12-31 12:11:21   

Thanks for your response Arsondpi.
I'm still struggling were to put the .random_img_title code in the style .css (line number) Do I need to also enter any of the code that I put on line 45 in the random image plugin?

Will this then allow me to switch on and off the captions with indexhibit backstage?

Thanks for you help.
Have a good New Years!

Stuart

arsondpi / 2012-12-31 14:28:16   

- put this anywhere on your style.css
- yes
- no titles will always be visible.
You can duplicate format.random_image.php with your ftp application and rename the duplicate to format.random_image_with_titles.php and work on that file.

matthewsstuart / 2013-01-02 14:28:47   

Thank you very much Arsondpi!

Best

Stuart

This thread has been closed, thank you.