详解WordPress中添加友情链接的方法


当前第2页 返回上一页

2.添加css美化,以下是个人的css,供大家参考

.lists {padding: 5px; margin: 25px auto auto 0;}
.linkcat {font-size: 12px; font-weight: bolder; padding: 5px; margin-bottom: 15px; list-style: none; clear:both}
.lists li h2 {font-size:14px; margin-bottom: 15px; color: #99CC33; }
.listcat ul {margin-left: 20px;}
.linkcat ul li {float: left; margin-bottom: 20px; margin-left: 20px; padding: 4px 0 4px 6px; width: 150px; border: 1px solid #d9d9d9;}
.linkcat ul li a {color: #a4a4a4; text-decoration: none;}
.linkcat ul li a img {margin-right: 3px;}
.linkcat ul li a:visited {color: #a4a4a4;}
.tips {font-size: 14px; margin-bottom: 18px; margin-left: 5px;}

使用jQuery
具体实现步骤分两步:
1.加载jQuery库,可以直接调用google jQuery库

代码如下:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

2.加载jQuery功能代码,注意jQuery闭合
$(".linkpage a").each(function(e){
$(this).prepend("<img src=http://www.google.com/s2/favicons?domain="+this.href.replace(/^(http:\/\/[^\/]+).*$/, '$1').replace( 'http://', '' )+">");
});
这段jQuery的意思是遍历所有class为linkpage下所有的a标签,然后对该a标签添加img,其中是“.linkpage”需根据自己的模板更改。

标签:WordPress

返回前面的内容

相关阅读 >>

wordpress中is_singular()函数简介

wordpress中j.parentnode为空或不是对象的解决方法

wordpress必备数据库sql查询语句整理

wordpress 插件直接将服务器文件导入媒体库

docker搭建 nginx+php+mysql 环境并部署wordpress实践

探讨一下国外主流建站工具的优缺点

wordpress实现登录或退出后直接跳转回首页的方法

wordpress速度优化-nginx fastcgi_cache缓存加速

获得google pr值的php代码

wordpress dynamic_sidebar()函数使用方法

更多相关阅读请进入《wordpress》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...