分類 Feed 圖示提取到連結前端
- Posted by Beata on 四月 17th, 2006 filed in wordpress
布羅特認為Feed圖示放在分類後端在顯示上略為雜亂,所以想將Feed圖示提取到連結前端。
因此發佈這篇文章提供一下修改方式…
開啟 wp-includes/template-functions-category.php
找到並剪下這段
-
// 段落開始
-
-
$link .= ‘ ‘;
-
$title = ‘ title="’ . $feed . ‘"’;
-
$alt = ‘ alt="’ . $feed . ‘"’;
-
$name = $feed;
-
}
-
-
$link .= ‘(<a href="’ . get_category_rss_link(0, $category->cat_ID, $category->category_nicename) . ‘"’;
-
$link .= $title.‘>’.$name.‘</a>)’;
-
}
-
-
$link .= ‘<img src="’.$feed_image.‘"’.$alt.$title.‘ onclick="window.location.href=\’‘.get_category_rss_link(0, $category->cat_ID, $category->category_nicename).‘\’" /> ’;
-
}
-
}
-
// 段落結束
將剪下的這一整段貼到$num_found++;之後
並且在$num_found++;之後加上
找到
把「=」改成 「.=」
四月 17th, 2006 at 9:50 下午
好像在最新的WP 2.0.2版本中没有作用。
四月 17th, 2006 at 10:11 下午
wp_list_cats(); 有設定過了嗎?
四月 18th, 2006 at 1:48 上午
對不起,我忘了細節沒調整
請再試一次…
四月 18th, 2006 at 6:39 上午
按照您重新发的修改方法,已经修改成功了。Thank you very much!另外再补充一点,如果要把每个分类的日志数左右的()改成[],是在$link .= ‘ ['.intval($category->category_count).']‘;这一句里。懒懒猫我不太知道你用的WP程序版本,貌似和我看到的实际代码不太一样,我是自己琢磨了一下才最后改好的。第一段里应该是你的这个显示代码插件自动加上的。中间的代码比WP2.0.2里少了一段,而且顺序也不同 。我的是:
if ( (! empty($feed_image)) || (! empty($feed)) ) {
$link .= ‘ ‘;
if ( empty($feed_image) )
$link .= ‘(’;
$link .= ‘<a>cat_ID, $category->category_nicename) . ‘"’;
if ( !empty($feed) ) {
$title = ‘ title="’ . $feed . ‘"’;
$alt = ‘ alt="’ . $feed . ‘"’;
$name = $feed;
$link .= $title;
}
$link .= ‘>’;
if ( !empty($feed_image) )
$link .= "’;
else
$link .= $name;
$link .= ‘</a>’;
if (empty($feed_image))
$link .= ‘)’;
}
最后的
把「=」改成 「.=」
其实是把$link =改成$link .=吧。
问题完全解决,非常谢谢你。
四月 18th, 2006 at 11:21 下午
那可能是某年某月我自己改了template-functions-category.php
然後卻忘了改哪些部份了…
以你的為準囉!
四月 20th, 2006 at 2:28 下午
懒懒猫,我还想问你一下:那个每篇日志的Hit:xxx 这是用的什么插件?或者是什么其他WP自带的语句吗?
四月 20th, 2006 at 3:21 下午
應該是WP的Plugin吧^^(不負責回答XD)
四月 20th, 2006 at 3:59 下午
WP-PostViews 1.00
雖然我不是用這套(沒時間換)
但我覺得這套比較好
因為有防重新整理
四月 20th, 2006 at 4:11 下午
意思就是说一个访客刷新页面,文章的阅读次数还是不变对吗?应该这样才好。
四月 20th, 2006 at 4:13 下午
是的
——– Update ———
我好像記錯了…
防重新整理的應該是另外一套…可惜我忘記名字了
唉!如果這套沒辦法防重新整理就請節哀囉~
四月 20th, 2006 at 4:17 下午
葱白你的恢复速度。
四月 20th, 2006 at 4:18 下午
我装上去怎么全部显示是0呢?而且侧边还空白了。
四月 20th, 2006 at 4:21 下午
侧边空白原来是禁用了另一个插件。但是这个postviews必须从安装以后才计数吗?
四月 20th, 2006 at 4:22 下午
對呀:噴汗:
沒安裝前哪兒來的數據?
四月 20th, 2006 at 4:26 下午
Wordpress默认不计数的吗?那只能一切从头开始了。:熊貓:
四月 20th, 2006 at 4:33 下午
顺便再问个问题,有没有办法可以实现“显示标题和文章摘要”和“只显示标题”这样切换。LBS和pj-Blog好象都有这功能。懒懒猫你可以看看www.conjee.com/blog 在右边上方有View Mode: Normal | Article List这样的。可以在2者之间换模式。
四月 20th, 2006 at 4:39 下午
很不錯的作法
有空再弄
十月 27th, 2006 at 12:03 下午
[...] Beata- WP Plugin:: Ajax Comments-Reply V1.0 很想很想弄,但又懶得弄這個 WP 分類列表選項 很有用的技巧! 固定網址的可用變數 分類 Feed 圖示提取到連結前端 Plugin 中使用語系檔 隨機顯示字條 [...]