Wordpress在http后向img url添加额外的斜杠 [英] Wordpress adding extra slash to img url after http

查看:23
本文介绍了Wordpress在http后向img url添加额外的斜杠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Wordpress 正在为我的 网站 上的 img 网址的 http 后添加一个额外的斜线
图片网址应该看起来像一个普通的网址,但图片标签应该是这样的:
http:///www.dreamteam.gg/wp-content/uploads/2016/01/crowd.jpg
注意 http:
后面的额外斜线不知道是什么原因造成的,因为这些链接不是我添加的,它们是由三个独立的插件制作的,它们都这样做.任何帮助将不胜感激.谢谢!

Wordpress is adding an extra slash after http for img urls on my site
The image urls should look like a normal url but instead the image tags are like this:
http:///www.dreamteam.gg/wp-content/uploads/2016/01/crowd.jpg
notice the extra slash after http:
Not sure what would be causing this because these are links are not added by me, they are being made by three separate plugins and they all do this. Any help would be greatly appreciated. Thanks!

推荐答案

我无法找出最初导致此问题的原因,但我将此脚本放在页脚中并修复了我的所有图像 src 链接.

I couldn't find out what initially caused this issue but i put this script in the footer and it fixed all my image src links.

$('img').attr('src',function(i,e){
  return e.replace("http:///w","http://w");
})

确保您正在将 jQuery 导入您的页面,否则这将不起作用

Make sure you are importing jQuery into your page or this won't work

这篇关于Wordpress在http后向img url添加额外的斜杠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆