Advanced Post Image Plugin
2009年06月01日
English
Advanced Post Images plugin can generate thumbnails of the first image of latest (number is set by user) posts and link back to the them.
Installation and Usage
- Upload the advanced-post-image.php to to the /wp-content/plugins/ directory
- Activate the plugin through the 'Plugins' menu in WordPress
- Place <?php get_post_image_list(); ?> in your templates
- create the folder thumb under the directory wp-content/uploads/, and set it to 777
If you want to control the number, the thumb image's width and height, you can use the following four parameters in the function <?php get_post_image_list(); ?>
$image_number = 10 // the image number, default is 10 $thumb_width = 50 // the thumb image's width, default is 50px $thumb_height = 50 // the thumb image's height, default is 50px $type = "recent" // the list's type, "recent" displays latest posts's image while "random" display random posts's image
You can use the ul.post-image-list CSS selector to stlye the images list.
Download: Advanced Post Image Plugin
Demo:

You can donate via payapl to support the plugin's development,
中文
这是该插件的初始版本,Advanced Post Image 插件会生成最新日志(数字由用户设定)的第一张图片的缩略图,然后产生一个链回原来日志的列表。
安装和使用
- 上传 advanced-post-image.php 到 /wp-content/plugins/ 目录下
- 在插件菜单下激活插件
- 在模板文件中适当的位置插入 <?php get_post_image_list(); ?> 模板函数
- 在 wp-content/uploads/ 目录下创建 thumb 文件夹并将其设置为 777
你可以使用函数 <?php get_post_image_list(); ?> 的以下四个参数:
$image_number = 10 // 设置显示图片个数,默认为10 张 $thumb_width = 50 // 设置所略图的宽度,默认为 50 像素,如果为 0,则会根据高度自动修改,但是宽度和高度至少填一个 $thumb_height = 50 // 设置所略图的高度,默认为 50 像素,如果为 0,则会根据宽度自动修改,但是宽度和高度至少填一个 $type = "recent" // 设置列表的类型,"recent" 显示最近日志的图片, "random" 则显示随机日志的图片
你可以根据 ul.post-image-list 这个 CSS selector 去样式化图片列表
48 条评论 添加你的评论 →

1. Denis | 2007:10:16 - 15:21:02 | #
这个版本可能存在一些问题,也找不到人帮我测试,如果使用上有问题,欢迎向我 report !
2. 你好,老师,请教一个问题 | 2008:03:17 - 21:00:16 | #
我开启Advanced Post Image Plugin插件后,并在主页的sidebar ,下方调用了这个 函数,结果出错提示
nable to open ‘E:\xampplite\htdocs\wordpress/wp-content/uploads/thumb/thumb_3.thumbnail.jpg’ for writing: No such file or directory in,我看了一下自己的文件目录,图片在../uploads/thumb/2008/03中,是目录路径问题吗,我该怎么做才能读出图片呢我用的版本是2.3的,谢谢
3. Denis | 2008:03:17 - 21:09:41 | #
在 wp-content/uploads/ 目录下创建 thumb 文件夹并将其设置为 777
不好意思,我不是老是….
4. 倮虫 | 2007:10:20 - 03:19:00 | #
不能再扩展一下,把BLOG里的图片按分类读出来?形成一个图片汇总。当然,汇总页里也要有图片所属的BLOG链接。
5. MO | 2007:10:20 - 11:44:44 | #
如果文章里面没有图片,是不是就不能生成缩略图了呢?
6. Denis | 2007:10:20 - 22:56:21 | #
@裸虫,不能!
@MO,是的,他是获取日志的第一张图片!
7. 王凤泽 | 2007:11:07 - 13:42:02 | #
你的Honey Piggy就是用的这个插件吧!我就是想实现你的Honey Piggy这种效果,但是我装上之后,只能单列显示图片,而且宽度不一。我希望能宽度我指定,长度自动,两列显示。请问应该如何修改?
8. Denis | 2007:11:07 - 16:27:39 | #
@汪凤泽,这个是下个版本的功能!
9. badblue | 2007:11:18 - 11:12:37 | #
如果图片要横向排列的话我要怎么做!现在装了插件图片是竖排的
10. badblue | 2007:11:18 - 22:52:35 | #
这外插件能够随机变支提取图片就好了!现在是固定的,有点死呀!
11. 玛雅 | 2007:12:02 - 08:37:31 | #
不错的插件,不过我在2.31上装不成功,在sidebar插入(?php get_post_image_list(); ?)后不显示,这个代码之下的内容都不显示,你说是怎么回事飞猪先生?
12. lucius | 2007:12:05 - 02:41:44 | #
hi hi
thanks for the great easy to use plugin.
but how to i get my images to align say in rows of 5
in stead of 1 row?
thanks!
13. MO | 2007:12:08 - 10:37:22 | #
^-^ 我修改了这个插件,使它可以选择生成最新或者随机N篇日志的缩略图。地址 http://www.lxooo.com/advanced-post-image-plugin.html
14. Andrea | 2007:12:16 - 19:14:05 | #
Your plugin is great, thank you. How do you make the images stay not in one long line, but in rows instead??? you did it in this page, one time in the sidebar and one time where it says”demo”. Pleeease explain how you did it. Thank you very much
15. Denis | 2007:12:16 - 19:54:00 | #
@Andrea, the output of the plugin will be an unorder list, so you just need to use CSS to style the unorder list
16. Andrea | 2007:12:16 - 21:03:04 | #
Thank you for your fast answer. Do i have to change the general css file(style.css) or make a new one just for your plugin? what does your code look like for the honey piggy 3×2 exactely? thank you very very very much
17. Denis | 2007:12:18 - 00:22:14 | #
@Andrea you can add it to your style.css. becaue every CSS setting is different, I can’t simply copy my CSS code to you.
18. Andrea | 2007:12:18 - 00:45:45 | #
i tried with display:inline and display:table-row , also tried with float, but none of them work….sigh…
19. Denis | 2007:12:18 - 01:26:26 | #
@Andrea if you like and trust me, I can modify it for you, you can send your admin account and password to my gmail
honghua.deng#gmail.com (#=>@)
20. Andrea | 2007:12:18 - 17:37:28 | #
hey thanks a lot for your helpp, i really appreciated it. I’ll sure link to your website. thanks again
21. Joshua | 2008:02:25 - 10:01:16 | #
Hello, this plugin is so good, thanks for making it.
Is there a way to sort the images randomly from any of my blog entries instead of sorting the images from recent posts?
22. Denis | 2008:02:27 - 14:06:13 | #
I will add this function in the next version.
23. Miki | 2008:02:26 - 05:46:04 | #
how can I enhace the quality of the pictures?
24. Miki | 2008:02:26 - 06:07:05 | #
i mean the thumbnails sorry
25. Joshua | 2008:02:27 - 05:35:16 | #
Hello?
26. Denis | 2008:02:27 - 14:08:04 | #
yes, you can, edit the plugin, and change the value of $thumb_height and $thumb_width.
27. bssn | 2008:02:28 - 23:27:33 | #
原来这是你的原创啊!
28. bssn | 2008:02:29 - 02:10:56 | #
文章必须是本地的吗?
29. Maxx | 2008:02:29 - 02:52:46 | #
I love the upgrade! Now I can order by random.
Thanks so much for making this plugin so good.
I noticed you have an extra semicolon on line 15.
Again thanks so much for making this.
30. Denis | 2008:02:29 - 10:42:20 | #
haha, I always make mistakes
, thanks for your help. I will correct it soon.
31. Gomus | 2008:03:01 - 03:57:56 | #
New version, wohoo! Best plugin ever.
32. Joshua | 2008:03:16 - 23:52:17 | #
Thanks so much for this, it is awesome.
33. zzz | 2008:03:30 - 23:38:53 | #
I insist this one is much better than ur plugin.
http://www.alakhnor.com/post-thumb/
34. Mar | 2008:04:20 - 02:17:41 | #
I love this plugin but I’d like to show post title above or below thumbnails. Is it possible?
35. Denis | 2008:04:21 - 13:01:09 | #
yes, you should modify the source code.
36. Maxx | 2008:04:29 - 11:52:29 | #
best plugin ever!
thanks for developing this.
37. Matthias | 2008:05:07 - 16:29:35 | #
Thank you, nice plugin.
But I got a short question: is it possible that i just get posts from a specific category and not just the latest posts?
that would be perfect!
greets
38. Denis | 2008:05:07 - 17:00:31 | #
I will try to implement this feature in next release
39. Matthias | 2008:05:07 - 19:25:32 | #
Thats nice, thank you very much
40. baron | 2008:05:08 - 00:34:10 | #
hi there .thanks for plugin:
Does anybody know if tis script is compatible with Wordpress 2.5.1 ?
Thanks in advance for any help on this!
best regards
41. Denis | 2008:05:08 - 01:19:36 | #
yes!
42. coldbo | 2008:05:09 - 04:30:16 | #
为什么调用很慢,我就生成一个缩略图,每翻一次页,就得等半天,老慢老慢.是个好插件,请教怎么才能……….
43. florry | 2008:07:06 - 21:37:25 | #
Hello,
In the thumbnail plugin the location of the image gets set to a folder. I pull in my images from flickr and other places how can I change the path to a URL.
Thanks,
F
44. Denis | 2008:07:06 - 23:59:42 | #
no idea what do you mean, sorry!
45. idea-cool | 2008:07:13 - 15:21:14 | #
怎么设置图片压缩质量,默认的质量比较低
46. 孤星飞 | 2009:05:16 - 19:12:59 | #
请问横向排序显示,又该如何做?
47. burhanuddin | 2009:05:22 - 16:36:36 | #
same as Matthias.
my question is it possible that i just get posts from a specific category and not just the latest posts?
48. 维秋 | 2009:09:21 - 15:03:03 | #
我有一个请求,希望可以同时调用日志的标题,还有指定调用的分类,如果还可的话,再加一个可以指定单篇日志就更好了,呵呵,谢谢。希望得到回复。中秋快乐。