Show x-amount of images on homepage in a grid

Hello everyone,

I have spent a while here in the forums looking for a solution but been unable to find one. On our homepage I need to bring X-amount of images that are chosen randomly and show them in a grid-like view. I was testing the items-shortcode which does exactly what we need but only the output is “wrong”. We are using the Thanks Roy-theme.

My question is: as it seems, the shortcode is defined in the theme’s functions.php and the actual content is called through Omeka_View_Helper_Shortcodes::shortcodeItems($args, $view); which is at /application/views/helpers/Shortcodes.php. There it loops the content X-amount of times calling the $view->partial(‘items/single.php’, array(‘item’ => $item)) . single.php is located on the theme folder.

Should I modify the single.php to show the images or should I write a custom shortcode or is there an easier approach to my dilemma?

I have tried the carousel which does the trick but the owner wants a grid-view of images instead of carousel.

Thank you already in advance!

What’s wrong about the output, just that it isn’t in a grid?

“items/single.php” will affect any place the theme tries to output a little summary view of a single item: this typically happens on the homepage for “recent items” or “random featured items,” and is used other places like the shortcodes.

You could alter that view (you can copy it into your theme and change it there to avoid hacking the core), but it will affect anywhere else the single.php file is used. If it’s just the homepage you need to have this on, you could write what you need right into the index.php view for the theme, too.