我的inove主题侧边栏读者墙添加
这个inove主题我用了挺长的一段时间了。虽然 知道用的人很多,淡因为个人比较喜欢加好用才是硬道理的不变真理,我打算坚持用下去。所以花在折腾这个主题上的时间不少。平时在童鞋们的博客溜达,看到蛮多的朋友侧边栏添加了评论版头像显示,即侧边栏读者墙。这不,前天晚上经过一番折腾我也搞定了。多亏丕子兄的帮助。 我参考了ZWWoOoOo大神写的《WordPress 免插件读者墙 willin 版本》和荒野无灯大神写的《Wordpress免插件版读者墙》,两者略有区别,但实现的效果基本一样。后来在inove主题的sidebar.php文件里加了读者墙代码,查看了下效果,我的是垂直显示的。因为自己没有加读者墙部分内容的Css吧,我复制了ZWWoOoOo写的那段Css,添加到style.css里,但发现我的读者墙显示依旧存在问题。后来我想起丕子兄也是inove主题且已经添加了这个效果就直接找他要啦。他发给我他的侧边栏代码,我看了看貌似是ZWWoOoOo写的那段,后来他给我发了他自己的那段定义读者墙的css,我复制上去,果然OK。在此多谢丕子兄的帮助。后来我结合ZWWoOoOo的css,替换了几句,现在的这个效果出来了。自我感觉良好。
<div class="widget"> <h3>活跃朋友</h3> <ul class="ffox_most_active"> <?php $counts = $wpdb->get_results("SELECT COUNT(comment_author) AS cnt, comment_author, comment_author_url, comment_author_email FROM (SELECT * FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->posts.ID=$wpdb->comments.comment_post_ID) WHERE comment_date > date_sub( NOW(), INTERVAL 1 MONTH ) AND user_id='0' AND comment_author != '朵未' AND post_password='' AND comment_approved='1' AND comment_type='') AS tempcmt GROUP BY comment_author ORDER BY cnt DESC LIMIT 30"); foreach ($counts as $count) { $c_url = $count->comment_author_url; if ($c_url == '') $c_url = 'http://www.happyla.net/'; $mostactive .= '<li class="mostactive">' . '<a href="'. $c_url . '" title="' . $count->comment_author . ' ('. $count->cnt . 'comments)">' . get_avatar($count->comment_author_email, 24) . '</a></li>'; } echo $mostactive; ?> </ul> <div class="fixed"></div> </div>
如果用inove主题的朋友,可以直接复制我的代码修改。如下是我添加在sidebar.php的代码,用的是ZWWoOoOo的,荒野无灯的效果一样。大家可以自己定位。 请把以上代码中的朵未那里改为你自己的昵称,网址也替换成你自己的。comment_author_email,24中的24是定义头像的大小,大家可以自己调整。 附我的CSS代码,请加在主题的style.css里面。
#sidebar .widget .ffox_most_active li { list-style:none; float:left; border:none; padding-left:0; width:26px; background:none; } #sidebar .widget .ffox_most_active img.avatar { width:24px; height:24px; border:1px solid #ddd;padding:2px;margin:0 1px 0 0; }
24那里也是定义大小的。使用inove主题的朋友可以直接添加。另外的主题我没有试过,不过应该也是可以的。
zblog的好少啊
.-= 场子官方博客´s last blog ..舍不得听的校园歌曲。自选 =-.
[回复]
朵未 回复: Firefox 3.6.3 Windows XP
4月 30th, 2010 at 5:28 下午
zblog有zblog的圈子。用WP的部分人是用国外的。
[回复]
不错,有时间可以调试下下试试~~~
.-= Peter´s last blog ..幸福像花儿一样 =-.
[回复]
朵未 回复: Firefox 3.6.3 Windows XP
4月 30th, 2010 at 5:27 下午
恩,喜欢的话,加一个也无妨。
[回复]
看着蛮漂亮的
就是不知道影响速度不。
.-= 园子´s last blog ..E63 手机安装字体全攻略 =-.
[回复]
朵未 回复: Firefox 3.6.3 Windows XP
4月 30th, 2010 at 5:27 下午
一般主机别太慢,开这个影响不大吧。
[回复]
不错吗 你的都带上头像了
.-= 郑州seo´s last blog ..今年五一怎么过 =-.
[回复]
朵未 回复: Firefox 3.6.3 Windows XP
4月 30th, 2010 at 5:26 下午
丰富下侧边栏内容。
[回复]
还没有加这道墙。。
.-= 飞猪´s last blog ..塘朗山梅林水库穿越攻略 =-.
[回复]
朵未 回复: Firefox 3.6.3 Windows XP
4月 30th, 2010 at 5:26 下午
你的博客简洁啊。
[回复]
我只负责点广告
.-= 90后的贼´s last blog ..写90后博客1周年了,回忆一下 =-.
[回复]
朵未 回复: Firefox 3.6.3 Windows XP
4月 30th, 2010 at 5:25 下午
呵呵 :)
[回复]
哈哈~榜上有名~
你这个墙好像没有显示评论数的,
ZWW也写过一篇不用插件添加读者墙的文章~
我也有考虑添加读者墙,不过这两天我的blog上不了,郁闷。
到时我的站弄好了就会回复你啦~哈~~
[回复]
朵未 回复: Firefox 3.6.3 Windows XP
4月 30th, 2010 at 3:28 下午
恩,我看了下。FF下正常,IE不显示。我换荒野无灯的试试看IE下能显示不。
[回复]
来观摩一下,我似乎用不上,因为人不多
[回复]
朵未 回复: Firefox 3.6.3 Windows XP
4月 30th, 2010 at 3:14 下午
呵呵,以后会用的着的。
[回复]
没看到我呢,看来还得多水水
.-= 掌柜的马甲´s last blog ..个人收藏之杂图[24] =-.
[回复]
朵未 回复: Firefox 3.6.3 Windows XP
4月 30th, 2010 at 2:50 下午
还有个页面的墙,那里有你。呵呵。
[回复]
不错,特来围观
.-= zwwooooo´s last blog ..再次出售WordPress主题: zNone =-.
[回复]
朵未 回复: Firefox 3.6.3 Windows XP
4月 30th, 2010 at 2:06 下午
呵呵,欢迎zwwooooo 大神光临指导。
[回复]
为什么移上去不提示留言条数了
.-= Ray Chow´s last blog ..Ubuntu 10.04 偷跑啦 =-.
[回复]
朵未 回复: Firefox 3.6.3 Windows XP
4月 30th, 2010 at 2:06 下午
额,你用的是什么浏览器,FF下正常。
[回复]
主题好用的人才多嘛。自己再优化一下就完美了
.-= 扯远了´s last blog ..申通,通还是不通? =-.
[回复]
朵未 回复: Firefox 3.6.3 Windows XP
4月 30th, 2010 at 2:05 下午
我不怎么会改,banner的图很粗糙的换了张。
[回复]
先大概的瞄一下,下来再细看。我的主页不知道能不能用。
.-= 懒虫´s last blog ..忙碌 =-.
[回复]
朵未 回复: Firefox 3.6.3 Windows XP
4月 30th, 2010 at 2:05 下午
你的可以用小松的读者墙插件。加页面的。可以参考小松的读者墙和我的emlog的读者墙。
[回复]
哈哈 我榜上有名
.-= ikeeptrying´s last blog ..《天下网商》创刊 阿里传媒链形成 =-.
[回复]
朵未 回复: Firefox 3.6.3 Windows XP
4月 30th, 2010 at 2:04 下午
呵呵,是啊。多谢你的支持!
[回复]
代码帝
.-= 竹纤维-小国´s last blog ..泪别华洋,重回舒洁雅 =-.
[回复]
朵未 回复: Firefox 3.6.3 Windows XP
4月 30th, 2010 at 2:03 下午
啥?欢迎来玩。
[回复]
z-blog没办法添加
.-= 摩尔博客´s last blog ..“猫坚强”人更需要坚强 =-.
[回复]
朵未 回复: Firefox 3.6.3 Windows XP
4月 30th, 2010 at 2:03 下午
z-blog页面的有的,侧边栏的估计也有。你可以找找看。
[回复]
额,不错,学习了,想想怎么弄我空间去,嘿嘿
.-= TTkea´s last blog ..ubuntu Linux最最简单安装fcitx输入法(图解-菜鸟教程) =-.
[回复]
朵未 回复: Firefox 3.6.3 Windows XP
4月 30th, 2010 at 2:03 下午
加油~~
[回复]
汗。。沙发被抢了。
.-= heroicYang´s last blog ..腾讯SOSO概念产品 =-.
[回复]
朵未 回复: Firefox 3.6.3 Windows XP
4月 30th, 2010 at 2:02 下午
哈哈。
[回复]
嗯,抢了个沙发。有空我也试试。
.-= heroicYang´s last blog ..腾讯SOSO概念产品 =-.
[回复]
朵未 回复: Firefox 3.6.3 Windows XP
4月 30th, 2010 at 2:02 下午
恩,需要的时候再折腾啦。
[回复]
我对读者墙还有点纠结。
[回复]
朵未 回复: Firefox 3.6.3 Windows XP
4月 30th, 2010 at 2:02 下午
呵呵,你的博客只适合添加页面的。
[回复]