Amazon Images
-
I’ve got insecure amazon images loading on my wordpress site. I’ve researched around and found that if I replace the following:
This:
https://ecx.images-amazon.com/images/I/51oHwrkeiAL._SL160_.jpgWith this:
https://images-na.ssl-images-amazon.com/images/I/51oHwrkeiAL._SL160_.jpgIt solves my issue.
So now, researching around bit, I am, trying to add my own function into my themes functions.php file that will find this and replace no matter where on my site it appears.
This is what I am trying to use:
function replace_content($thumbnail)
{
$thumbnail = str_replace(‘https://ecx.images-amazon.com’, ‘https://images-na.ssl-images-amazon.com’,$thumbnail);
return $thumbnail;
}
add_filter(‘the_content’,’replace_content’);I have very little experience with PHP, and am not sure what I am doing here, but at the same time, I think I am getting close.
Anyone have any insight?
- The topic ‘Amazon Images’ is closed to new replies.