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中j.parentnode为空或不是对象的解决方法
docker搭建 nginx+php+mysql 环境并部署wordpress实践
wordpress速度优化-nginx fastcgi_cache缓存加速
wordpress dynamic_sidebar()函数使用方法
更多相关阅读请进入《wordpress》频道 >>
相关推荐
评论
管理员已关闭评论功能...
- 欢迎访问木庄网络博客
- 可复制:代码框内的文字。
- 方法:Ctrl+C。