• Hi – this seems to be just what I’ve been looking for. I have a problem though: it only displays one image from my attachment list, and it seems to be the image with the lowest id.

    I’m using a shortcode in a sidebar like this:

    [mpress_image_refresh attachment=”161, 165, 164, 163, 162″ size=”full”]

    But it only ever displays image 161, no matter how many times I refresh. If I remove 161 from the list, then it displays only 162, and so on.

    The same thing happens if I attach all those images to a post and use the post_id option. It still only displays image id 161.

    Can you please help?

Viewing 5 replies - 1 through 5 (of 5 total)
  • @supersi2,

    Can I ask you what web hosting company you are using?

    Thread Starter supersi2

    (@supersi2)

    Hi Micah – I’m using WPEngine. Could there be some caching going on?

    @supersi2,

    That was the expected answer. WPEngine doesn’t allow random queries in WordPress (which my plugin currently does). However, under their ‘Advanced Configuration’ settings in WordPress you can manually enable that option. However, I’m going to update the plugin to avoid using this approach.

    Thread Starter supersi2

    (@supersi2)

    Thanks Micah! I found the setting in my dashboard under WP Engine -> General Settings -> Advanced Configuration -> Allow ORDER BY RAND (for anyone who finds this post in the future). After enabling this it is working great.

    The plugin is perfect. Just an easy way to display a random image. I couldn’t find any other plugins that did this simple thing. Thank you!

    Micah Wood

    (@woodent)

    @supersi2,

    I’ve updated the plugin to avoid using the ORDER BY RAND approach, so when you upgrade to 0.4 of the plugin, you can undo the change in your settings on WP Engine if you like.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Only ever displays 1 image’ is closed to new replies.