我爱水煮鱼 » WordPress » Advanced Post Image Plugin

Advanced Post Image Plugin

文章目录[隐藏]

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

  1. Upload the advanced-post-image.php to to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Place <?php get_post_image_list(); ?> in your templates
  4. 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:
post-image-list

You can donate via payapl to support the plugin’s development, :-)


中文

这是该插件的初始版本,Advanced Post Image 插件会生成最新日志(数字由用户设定)的第一张图片的缩略图,然后产生一个链回原来日志的列表。
安装和使用

  1. 上传 advanced-post-image.php 到 /wp-content/plugins/ 目录下
  2. 在插件菜单下激活插件
  3. 在模板文件中适当的位置插入 <?php get_post_image_list(); ?> 模板函数
  4. 在 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 去样式化图片列表

下载:Advanced Post Image Plugin

演示:
post-image-list

标签:

分享到:

48 条评论 添加你的评论 →

  • Denis 2007-10-16 15:21:02 #

    这个版本可能存在一些问题,也找不到人帮我测试,如果使用上有问题,欢迎向我 report !

    支持 反对

    • 你好,老师,请教一个问题 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的,谢谢

      支持 反对

      • Denis 2008-03-17 21:09:41 #

        在 wp-content/uploads/ 目录下创建 thumb 文件夹并将其设置为 777

        不好意思,我不是老是….
        :twisted:

        支持 反对

  • 倮虫 2007-10-20 03:19:00 #

    不能再扩展一下,把BLOG里的图片按分类读出来?形成一个图片汇总。当然,汇总页里也要有图片所属的BLOG链接。

    支持 反对

  • MO 2007-10-20 11:44:44 #

    如果文章里面没有图片,是不是就不能生成缩略图了呢?

    支持 反对

  • Denis 2007-10-20 22:56:21 #

    @裸虫,不能!
    @MO,是的,他是获取日志的第一张图片!

    支持 反对

  • 王凤泽 2007-11-07 13:42:02 #

    你的Honey Piggy就是用的这个插件吧!我就是想实现你的Honey Piggy这种效果,但是我装上之后,只能单列显示图片,而且宽度不一。我希望能宽度我指定,长度自动,两列显示。请问应该如何修改?

    支持 反对

  • Denis 2007-11-07 16:27:39 #

    @汪凤泽,这个是下个版本的功能!

    支持 反对

  • badblue 2007-11-18 11:12:37 #

    如果图片要横向排列的话我要怎么做!现在装了插件图片是竖排的

    支持 反对

  • badblue 2007-11-18 22:52:35 #

    这外插件能够随机变支提取图片就好了!现在是固定的,有点死呀!

    支持 反对

  • 玛雅 2007-12-02 08:37:31 #

    不错的插件,不过我在2.31上装不成功,在sidebar插入(?php get_post_image_list(); ?)后不显示,这个代码之下的内容都不显示,你说是怎么回事飞猪先生?

    支持 反对

  • 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!

    支持 反对

  • MO 2007-12-08 10:37:22 #

    ^-^ 我修改了这个插件,使它可以选择生成最新或者随机N篇日志的缩略图。地址 http://www.lxooo.com/advanced-post-image-plugin.html

    支持 反对

  • 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

    支持 反对

  • 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

    支持 反对

  • 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

    支持 反对

  • 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.

    支持 反对

  • 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…

    支持 反对

  • 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 (#=>@)

    支持 反对

  • 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

    支持 反对

  • 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?

    支持 反对

  • Miki 2008-02-26 05:46:04 #

    how can I enhace the quality of the pictures?

    支持 反对

  • Miki 2008-02-26 06:07:05 #

    i mean the thumbnails sorry

    支持 反对

  • Joshua 2008-02-27 05:35:16 #

    Hello?

    支持 反对

    • Denis 2008-02-27 14:08:04 #

      yes, you can, edit the plugin, and change the value of $thumb_height and $thumb_width.

      支持 反对

  • bssn 2008-02-28 23:27:33 #

    原来这是你的原创啊!

    支持 反对

  • bssn 2008-02-29 02:10:56 #

    文章必须是本地的吗?

    支持 反对

  • 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.

    支持 反对

    • Denis 2008-02-29 10:42:20 #

      haha, I always make mistakes :oops: , thanks for your help. I will correct it soon.

      支持 反对

发表评论

你必须 登陆 之后才能留言。你可以使用以下方式快速登陆我爱水煮鱼:

使用新浪微博登陆 使用腾讯微博登陆 使用豆瓣登陆

你也可选择直接在本站 注册