首页 > 新闻资讯 > 如何在WordPress里高亮显示当前分类

如何在WordPress里高亮显示当前分类

1条评论
标签:
更多

当你在浏览一个分类时,WordPress自动给当前分类的<li>元素添加一个current-cat的class。

所以你需要做的只是编辑style.css文件,给current-cat class添加一个样式:

#nav .current-cat{
    background:#999;
    color:#222;
    text-decoration:underline;
}

大功告成!现在你的读者就能知道自己正在浏览哪个分类了。

原文地址:http://www.wprecipes.com/how-to-highlight-the-current-category

* 版权声明:作者WordPress啦! 转载请注明出处。

#1
这货坑爹, 木有 = = !

发表新评论

此内容将保密,不会被其他人看见。
  • 自动将网址与电子邮件地址转变为链接。
  • 允许HTML标签:<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • 自动断行和分段。

更多关於格式化选项的信息

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.