zoukankan      html  css  js  c++  java
  • wordpress主题开发:给标签云增加七彩背景色

    本篇文章不是标签而是标签的背景色是七彩的,有点绕口令,还是看图说话,本篇要实现的七彩标签云背景色如图所示:wordpress主题开发:给标签云增加七彩背景色
    要实现七彩标签云背景色代码也很简单,代码如下:

    1. <aside class="tags"><?php wp_tag_cloud('smallest=12&largest=12&number=45&order=DESC'); ?></aside>

    把这段代码放在侧边栏sidebar.php即可(smallest,largest表示字号大小,这里统一大小设置为12,number表示显示多少个标签,这里显示45个,order表示标签的排序方式,这里设置为降序,即安装标签含有的文章数量从多到少排序),同时还要在style.css样式表文件中加入以下代码:

    1. .tags{padding: 12px 13px 10px 15px;}
    2. .tags a:nth-child(9n){background-color: #4A4A4A;}
    3. .tags a:nth-child(9n+1){background-color: #428BCA;}
    4. .tags a:nth-child(9n+2){background-color: #5CB85C;}
    5. .tags a:nth-child(9n+3){background-color: #D9534F;}
    6. .tags a:nth-child(9n+4){background-color: #567E95;}
    7. .tags a:nth-child(9n+5){background-color: #B433FF;}
    8. .tags a:nth-child(9n+6){background-color: #00ABA9;}
    9. .tags a:nth-child(9n+7){background-color: #B37333;}
    10. .tags a:nth-child(9n+8){background-color: #FF6600;}
    11. .tags a{opacity: 0.80;filter:alpha(opacity=80);color: #fff;display: inline-block;margin: 0 5px 5px 0;padding: 0 6px;line-height: 21px}
    12. .tags a:hover{opacity: 1;filter:alpha(opacity=100);}

    给wordpress博客网站的标签云增加七彩背景色就是这么简单,自己动手,让博客网站炫起来。

  • 相关阅读:
    hdu4990矩阵快速幂
    预处理+状态压缩+剪枝——codefoece 1209E
    AC自动机处理多串匹配——cf1202E
    二维差分前缀和——cf1202D(好题)
    序列递推——cf1204E(好题)
    建模+线性dp——cf1201D
    暴力——cf1202C
    经典排序背包——cf1203F
    思维+贪心——cf1042D
    分块——cf1207F
  • 原文地址:https://www.cnblogs.com/wpxuexi/p/6623232.html
Copyright © 2011-2022 走看看