Displaying user image on home page of main site

I’ve looked within the forum but cannot find anything in regards to my situation.

I’m trying to create a masonry on the home page of our website and calling random images from specific users with specific fields.

For instance: An artist with the selected field of PHOTOGRAPHY (just one random image) would pull in for the masonry on the home page. This one photo would be a representation of the Photographers and this would update when the page would reload, grabbing some other artist in that field and displaying their image.

Is there an API call somewhere in the documentation that could help with this? Or, is this a PRO version thing?

Thank you!


There is no such shortcode to display random image of particular user. Though rtMedia Pro has attributes to categories images and display based on shortcodes. Please have a look into shortcodes here http://docs.rtcamp.com/rtmedia/features/shortcodes/gallery-shortcode/ But, random images can’t be done yet.


The solution I use for this is a separate gallery plugin, Media Library Assistant.

You would need rtMedia Pro and all images assigned to an attribute of “Artist” or “Photography” or “Artist” with terms of “Photography” for the taxonomy. That means your users, as they upload images, would have to assign the attributes to them. rtMedia Pro allows this, it’s one of its features.

Install Media Library Assistant, and then once installed copy the buddypress-hooks-example.php.txt file in the examples folder and make that its own plugin by making a directory for (/plugins/buddypress-mla-gallery/buddypress-hooks-example.php) and activate that as a second plugin. This second plugin allows MLA gallery to “talk” to rtMedia and get the links to the right page rather than the wordpress attachments page.

From there you’d insert

[mla_gallery my_custom_sql="rt_artist=photography orderby=rand " buddypress_urls='link' mla_caption="{+author+} - <strong>{+title+}</strong>" post_mime_type=image posts_per_page=1 ]

And then you would display the one random image from that category. Clicking the image would bring you to the image on the authors profile page.

MLA gallery is probably the most configurable gallery plugin in the entire world. It’s insanely powerful.

Have fun

Hi @illusionsglass,

Thank you for your contribution in community support as always! :smile: