I'm using Drupal Cycle module and list field_images items. I check 'random' button, but it is not working. I want get random image every refresh page. How can do it? field_sort_items or anyway solution?
You can do this in lots and lots of ways. This is 1 way without Views.
I did this for a homepage. I made 5 variables that hold
FIDs for files uploaded using FAPI
file_managed fapi element in an admin settings form.
hook_page_build if I'm on the homepage I created a render array that simply calls
theme_image using a random file id by loading my 5 variables into an array and using PHP's
array_rand() to extract 1 random array value.
Lastly, if you can get this far -- and you have page caching turned on ... you'll only get 1 image ever and it'll never be random. For the render array inserted using
hook_page_build you have to set
#cache => FALSE within the render array so Drupal will not cache your images and it will be random every pageload.