wordpress中文章点击图片放大

@TOC

1.下载auto-highslide插件

1
2
链接:https://pan.baidu.com/s/1bRYi4wE3fi591X3R1WNwZw 
提取码:oti4

直接下载上述链接中的压缩包即可

2.将下载的插件上传到wordpress

在wordpress界面点击“插件”-“安装插件”-“上传插件”,将压缩包上传安装即可

3.在head.php中添加部分代码

在服务器的文件管理器中,进入到public_html/wp-content/themes/your_theme/header.php文件,在</head>前加上如下代码

1
2
3
4
5
6
7
8
9
10
<script type="text/javascript">
jQuery(document).ready(function($){

$('.entry-content img,.entry-featured img').each(function(i){
if (! this.parentNode.href) {
$(this).wrap("<a href='"+this.src+"' class='highslide-image' onclick='return hs.expand(this);'></a>");
}
});
});
</script>
Error: API rate limit exceeded for 34.230.114.103. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)