rtMedia Gallery shortcode: load more button, thumbnail size, media collector

Hey guys,

Awesome plugin, it helps us a lot.

Objective
We are building a members-only community, on the homepage we want to display the 5 latest member photo uploads to public visitors. For more photos, visitors need to register.

Shortcode
Its pretty easy thanks to your awesome shortcode, we are using [rtmedia_gallery global=“true” media_title=false media_type=“photo” per_page=5]

Our questions

  1. How can we hide the “+Load More” button that shows up next to the 5 photos? Public visitors should only be allowed to see the 5 latest uploads.

  2. Which files of the plugin do we need to customise so its using the “medium” size for the rtmedia_gallery shortcode, and not the thumbnail sizes? Yes, we could just define bigger thumbnails, but the small thumbnails will be used for different purposes, too.

  3. Is there a way to create a dummy buddypress user and have all user-uploaded media copied automatically to the dummy user media gallery? This would be helpful to keep user photos access for registered users only, and we could make the dummy user public and show dummy user’s latest 5 photos on our home page.

We cant share a link as its localhost only atm. Hope this makes sense. Thanks to everyone.

Peter J and Rick

Hello @mrjones,

Thank you for nice words.

For your requirement, you need to create one custom page template and then call the shortcode from it using do_shortcode('[ your shortcode ]');

1.) In custom page template place one <div> element with any unique classname, and then hide Load More using that class.

For example :

<div class="noloadmore">
// do_shortcode
</div>

Now, add below CSS code to Custom Css tab under rtMedia admin settings:

.noloadmore .rtm-load-more { display: none; }

2.) For different thumbnail size you will need to do some custom coding as follow:

Use filter rtmedia_media_thumb to change thumbnail size.

For example :

<div class="noloadmore">
<?php
function change_rtmedia_image_size ( $src, $id, $media_type ) {
$url_arrray= wp_get_attachment_image_src( rtmedia_media_id() , 'rt_media_activity_image' );
return $src=$url_arrray[ 0 ];
}    
add_filter( 'rtmedia_media_thumb', 'change_rtmedia_image_size', 10, 3 );
echo do_shortcode( '[rtmedia_gallery global="true" media_title="false" media_type="photo" per_page="5"]' );
remove_filter( 'rtmedia_media_thumb', 'changeimagesize', 10, 3 );
?>
</div>

3.) We are not very clear for this question but what you have suggested is not possible.

Thank you,

–Pranali

Chapeaux! Everything works perfectly. Pretty awesome, thanks so much and have a lovely weekend,

You are welcome @mrjones.

Glad to know that it worked for you.

I am closing this thread, feel free to create new if you face any other issue.

Thank you.