Set 'Albums' as default landing page in Media tab on Buddypress Groups


#1

Hi,

When clicking on the Media tab in a Buddypress Group, the ‘All’ tab is the default tab, so it shows all photos uploaded to that group, but I would prefer the ‘Albums’ tab to be the default tab. I have looked in all the PHP files and I still cannot figure out how to set this.

Any help would be appreciated. Thank you.


#2

Hello @Windurin,

Unfortunately, it is not possible to set Album tab as default as of now but there is one possibility if you want to make it default in anyway. You can alter Media-slug and replace it with Album-slug using filter. We do have filter for media profile rtmedia_media_tab_slug but not yet for BuddyPress group.

We can add a filter for you, If you want to change it this way. We can provide sample code if you need.

Let us know. Thanks.


#3

Hi,

Yes please. I would appreciate it if you could send me the code and explain how and where to implement it. Thank you.

Chris Anderson.


#4

Hello, could you provide the code as suggested above please? And how and where to use it? Thank you.


#5

Hello @Windurin,

Below is the sample code for Profile Media tab. You can add it to your theme’s functions.php file:

add_filter('rtmedia_media_tab_slug', 'custom_rtmedia_default_media_slug', 5, 1);
function custom_rtmedia_default_media_slug( $mediaslug ){
	$mediaslug = RTMEDIA_MEDIA_SLUG . "/".RTMEDIA_ALBUM_SLUG;
	return $mediaslug;
}

As mentioned we are not having filter for BuddyPress group as of now. We will add filter for you in next release. I will notify you regarding the release and will provide sample code for the same.

Thank you.


#6

Hi,

Thank you. That code worked perfectly. I look forward to the next release with the Groups filter and I appreciate the help.

Chris.


#7

I tried this code and it didn’t work for my theme.


#8

Hello @tammy1999,

That code will work fine.

Could you confirm if you get the same issue when the other plugins on your site are disabled and default theme of WordPress has been enabled?

Thank you.


#9

I turned off every thing except buddypress and rtmedia plugins and its still showing All Albums Photos


#10

Hello @tammy1999,

We have sent you a private reply regarding your query.

Thank you.


#11