Media Gallery Title


#1

Is there a way to change the title “Media Gallery” to something else when using shortcodes to display images.

I’ve seen threads showing how to change that same title in the member’s profile area, but haven’t been able to find a solution to change the “Media Gallery” title when using shortcodes to display images.

Is this possible?

Thanks


#2

Hi @rickc59,

Do the following,

  1. add the following function to theme’s functions.php

     function custom_shortcode_title(){
         global $rtmedia_query;
         if ( isset( $rtmedia_query->is_gallery_shortcode ) && true === $rtmedia_query->is_gallery_shortcode ) {
             ?>
             <h2 class="rtm-shortcode-gallery-title">
     	       <?php esc_html_e( 'YOUR TITLE GOES HERE', 'buddypress-media' ); ?>
             </h2>
             <?php
          }
     }
     add_action( 'rtmedia_gallery_after_title', 'custom_shortcode_title' ); 
    

And

2 . add the following css to rtMedia->settings->custom CSS

.rtm-gallery-shortcode-title-container .rtm-gallery-title {
     display:none;
    padding:0;
}

#3

That did it…thank you very much.


#4

@bhargavbhandari

How can I also do this for “Media Gallery” title on the profile pages? Thanks

Oops found it here Filters to change front end text Resolved


#5