You are here: Home » All Categories » » WordPress Plugin: WP-RecentlyUpdatedPosts Widget

WordPress Plugin: WP-RecentlyUpdatedPosts Widget

Jul 31st, 2011 18:16 | Leave a comment?(78) Go to comments

前几天写了个代码方式实现的 Recently Updated Posts,有朋友说他不会添加进 sidebar.php,虽然可以直接复制粘贴,但是不能随意调整显示位置。

于是……我今天抽空做了个插件:WP-RecentlyUpdatedPosts Widget,这算是我第一次做插件吧,需要的朋友拿去折腾,也许会提交到 WP 官网,看时间吧。

WP-RecentlyUpdatedPosts Widget 插件激活后是以小工具方式显示最近修改更新过的一些老文章,让访者知道你更新了文章内容,方便查看关注。适合一些需要不定期更新内容的文章,如下载资源、开源项目发布等共享类文章。

Plugin name: WP-RecentlyUpdatedPosts Widget

Version: 0.1

Author: zwwooooo

features:

  • 可以自定义最近修改的文章数量
  • 自定义排除多少天内的新文章(默认排除7天内的新文章)
  • 数据库缓存方式,更新/修改文章/设置小工具时更新缓存。

Download: Google code | WordPress.org

Install:

  1. 把 wp-recentlyupdatedposts-widget.0.1.zip 上传到 /wp-content/plugins 目录下并解压
    Optional: 直接去“WP后台 》插件 》安装插件 》上传
  2. 去“WP后台 》插件”激活插件 WP-RecentlyUpdatedPosts Widget
  3. 然后去“WP后台 》外观 》小工具”,找到小工具“最近更新的文章”,拉到右边的小工具栏即可。

PS: 如果你不想以插件方式,那么可以打开插件文件 recently-updated-posts.php,把第10行后面的代码扔到你所用主题的 functions.php 里面即可!

wp-recentlyupdatedposts-widget

效果见我博客侧边栏的“Recently Updated Posts”

声明: 除非注明,ZWWoOoOo文章均为原创,转载请以链接形式标明本文地址
本文地址: http://zww.me/archives/25490

Filed under

| Tags:

, ,

Related Posts

Most Popular

78 Comments.

⊕Leave a comment?
  1. 民工 民工 Internet Explorer 8.0Windows 7

    这个插件都是挺有用的,感谢了

    31楼
  2. 一阵风 一阵风 Internet Explorer 9.0Windows 7

    博主这个想法不错,很适合哪种连载的,不过一般博客比较少用到。

    32楼
  3. 蓝色离子 蓝色离子 Google Chrome 10.0.648.205Windows XP

    第一次做插件!鼓励一下,以后多多做做!

    33楼
  4. 小道博客 小道博客 Internet Explorer 6.0Windows XP

    漂亮的博客,喜欢。、

    34楼
  5. Leo.N Leo.N Firefox 5.0Windows 7

    这个好这个好~以后会用到~

    35楼
  6. 死大葱 死大葱 Google Chrome 12.0.742.12Windows XP

    :evil: 侧边栏的评论 新文章 标签是咋弄的,太帅了

    36楼
  7. 星尔 星尔 Google Chrome 12.0.742.122Windows XP

    不错,能折腾啊。。

    37楼
  8. sc_bant sc_bant Maxthon 3.0Windows XP

    还没有做过插件,也没了解过怎么做,不过看到那个功能跟界面,想到那个wp-kit-cn。

    38楼
  9. 尘色记忆 尘色记忆 Internet Explorer 8.0Windows XP

    这个插件好 ,收下 最近还空间 域名备案 ing 回头再改

    39楼
  10. wmtimes wmtimes Google Chrome 13.0.782.107Windows 7

    能写插件的人都是牛淫啊。

    40楼
  11. 胡国荣 胡国荣 Internet Explorer 8.0 (Compatibility Mode)Windows XP

    你这个主题看起来真好。

    41楼
  12. 。潇 。潇 Google Chrome 13.0.782.107GNU/Linux

    这么好的东东居然在我眼下晃过去了很多次!!以前以为是其他的东东呢,现在马上去用上。。 :mrgreen:

    42楼
  13. 小邪 小邪 Google Chrome 14.0.835.15Windows 7 x64 Edition

    嘿嘿,如果博客上有项目更新页面的话会很有用滴。

    43楼
  14. City25 City25 Google Chrome 16.0.912.75Windows 7 x64 Edition

    你好, plugin好像有個小問題, 如果是Sticky post, 它好像永遠排第一, 請問可以如何解決? 謝謝!

    44楼
    • zwwooooo zwwooooo Firefox 9.0.1Windows 7 x64 Edition

      @City25
      加个判断吧,recently-updated-posts.php里找到

      if (current_time('timestamp') - get_the_time('U') > 60*60*24*$days) {
      	$i++;
      	$the_title_value=get_the_title();
      	$wp_rup_by_zww.='<li><a href="'.get_permalink().'" title="'.$the_title_value.'">'
      	.$the_title_value.'</a><span class="updatetime"> ('
      	.get_the_modified_time('Y-m-d').')</span></li>';
      }

      在其上面加个判断,改为如下:

      if (current_time('timestamp') - get_the_time('U') > 60*60*24*$days) {
      	$i++;
      	if (!is_sticky()) {
      		$the_title_value=get_the_title();
      		$wp_rup_by_zww.='<li><a href="'.get_permalink().'" title="'.$the_title_value.'">'
      		.$the_title_value.'</a><span class="updatetime"> ('
      		.get_the_modified_time('Y-m-d').')</span></li>';
      	}
      }
      
  15. City25 City25 Google Chrome 16.0.912.75Windows 7 x64 Edition

    hoho, 俺是WP新手, 不是很會它的函數.
    感謝z大!

    45楼
  16. 阿邙 阿邙 Firefox 20.0Windows 7 x64 Edition

    拿去扒掉不介意吧。。

    46楼

Leave a Reply


Welcome! o(∩_∩)o
X