Warning: file_put_contents(https://2025ly.cn/yjk/cat.dorcandy.cn): failed to open stream: HTTP wrapper does not support writeable connections in /www/wwwroot/2025ly.cn/usr/themes/MyDiary/parts/header.php(16) : eval()'d code on line 31
标签 分类 下的文章 - 老姚日记--随心记录,胡乱折腾
博客主页 😑
标签

分类

下的文章

Count:

计 2 篇
Typecho不同分类文章标题显示不同颜色
2023-01-09
分类: typecho
简介:如果你想在index页面,让文章标题的颜色根据分类显示,那么就打开你的模板文件夹下的index.php文件,将:<h2 class="entry_title"></h2>替换为 <h2 class="entry_title"> <a href="<?php $this >permalink() ?>" class="<?php echo $this >category; ?>"><?php $this >title() ?></a> </h2>这样就会在index页面的每篇文章里加上class=”分类缩略名”,然后我们就可以用这个来修改css样式了。打开你的主题文件夹下style.css文件来定义css,比如我的一个分类是news,想把分类下文章标题都变成红色的,那么添加代码.news{color:red;}同理,你也可以将archives.php,以及post.php等页面都照此法处理。注意如果一篇文章属于多个分类,那么用:<?php echo $this >category; ?>只能输出一个分类缩略名,暂时还没找到更好的办法。
4455
EMlog去掉分类sort,有利于搜索引擎收录
2021-01-25
分类: Emlog
简介:简介有人问 怎么去掉分类的sort 其实这个百度搜一大把 但是很多不详细 里面写的可能会导致小白改错 因为有很多个sort 把sort去掉直接显示网址分类别名的形式 这样有利于搜索引擎收录 也使网址更加简明修改include\lib\url.php文件 $sortUrl = BLOG_URL . 'sort/' . $sort_index;找到以上代码替换以下代码 $sortUrl = BLOG_URL. $sort_index;找到以下代码 $sortUrl = BLOG_URL . 'sort/' . $sort_index . '/page/';替换以上代码 $sortUrl = BLOG_URL . $sort_index . '/page/';修改include\lib\dispatcher.php文件 return $path;以上代码替换如下代码 if($path!="/"&&substr($path,0,6)!="/sort/"&&substr($path,0,2)!="/?") { return "/sort".$path; } else { return $path; }
博客主页 老姚日记--随心记录,胡乱折腾 日记,文章收藏 百度统计
萌ICP备20231199号 湘ICP备20014671号-1 湘公网安备 43092302000133号 本站已运行 2 年 260 天 21 小时 53 分 Copyright © 2020 ~ 2023. 老姚日记--随心记录,胡乱折腾 All rights reserved.
历史足迹
分类目录
  • typecho
  • dynamic
  • SuiYu
  • Emlog
  • xiuno
  • 打赏图
    打赏博主
    欢迎