Modify media types "photo" to change default thumbnail issue


#1

Hi guy, I tried to change the default thumb for ‘photo’ but it doesn’t work for me, I have no error, but the original is still in place. I only replace all ‘music’ words by ‘photo’ and point the image URL to the right place. Tks


#2

@capobianco.brice - Why would you want a default thumb for a photo when it will show the original photo itself. Do you mean to change the default for audio and video?


#3

Arf, it is a misunderstangin. I thought is was also to change the default album pictures. Isn't it ?


#4

@capobianco.brice - The album would take the thumbnail of the latest media uploaded to it incase you haven't set any album cover exclusively.


#5

@joshuaabenazer I understand. For exemple, if you ONLY create onealbum in wich you upload some photo, it will take the latest pictures to use it as cover, but in this case, the default album "wall post" will not have any picture in it, and will display the default picture (polaroïd). I only want to change this one ;-)

Thanks


#6

@capobianco.brice - You would need to use this filter -> rtmedia_allowed_types - http://rtcamp.com/rtmedia/docs/developer/rtmedia-hooks/rtmedia_allowed_types/ for that, and assign your image url to $allowed_types['photo']['thumbnail'].


#7

Hi @joshuaabenazer, my original post was exactly on the page you've linked above. And my problem is still the same, nothing appened. I do not have any error. Will post some news here after updating all my plugins and wordpress core. Thanks


#8

Hi there, still note works :/ hope I do it right :

    function custom_rtmedia_default_photo_thumb($allowed_types) {  
    $allowed_types['photo']['thumbnail'] = get_template_directory_uri() .'/_inc/images/avatar.jpg';  
    return $allowed_types;  
}  
add_filter('rtmedia_allowed_types', 'custom_rtmedia_default_photo_thumb');  

Thanks ;-)


#9

@capobianco.brice - The above code should work actually. Where exactly are you placing the above code? Also have you tried echoing that url and checking if the image actually exists?


#10

Hi @joshuaabenazer, I place this code in my custom.php file wich is include at the beginning of my functions.php file ;-) And yep, I'm sure this image exists cause it is my default image I use everywhere on my site (to overload Gravatar default picture for exemple). ++


#11

@capobianco.brice - Looks like there is some issue with the filter. We are looking into it. Till then you could do the following.

global $rtmedia;  
$rtmedia->allowed_types[ 'photo' ][ 'thumbnail' ] = get_template_directory_uri() .'/_inc/images/avatar.jpg';  

#12

Thanks @joshuaabenazer, You rox, it works now ;-) Tell me when the filter will be corrected ;-)


#13

#14

#15