Tag Cumulus

User Center

2010
01-11
WordPress Thumbnails Anywhere 缩略图插件

插件演示:www.361cool.com

首先感谢 鸟类BLOG为我们提供这么优秀的产品

插件使用如下:

1. 首页缩略图

代码:

<?php if ( function_exists(‘thumbnails_anywhere_for_homepage’) ) {thumbnails_anywhere_for_homepage();} ?>

放置位置:于首页模板index.php,放在the_content或the_excerpt之前,例如:

<?php if ( function_exists(‘thumbnails_anywhere_for_homepage’) ) {thumbnails_anywhere_for_homepage();} ?>

<div>

<?php the_content(__(‘Read the rest of this entry &raquo;’)); ?>

</div>

<div> </div> //如果样式撑出来了,请补上这句用于清除样式。

也可以放置在分类模板文件或标签模板文件(通常是archive.php),总之,一切包含the_content或the_excerpt的地方都可以放置,专业的说法是任何loop之内都可以放置。鸟类分类页面的缩略图效果就是这样实现的。

2. 随机缩略图:

代码:(支持侧边栏)

<?php if(function_exists(‘thumbnails_anywhere_for_random_posts’)) { thumbnails_anywhere_for_random_posts(); } ?>

放置位置:任意位置。

3. 最新缩略图

代码:(支持侧边栏)

<?php if(function_exists(‘thumbnails_anywhere_for_recent_posts’)) { thumbnails_anywhere_for_recent_posts(); } ?>

放置位置:任意位置。

4. 相关缩略图:

代码:

<?php if(function_exists(‘thumbnails_anywhere_for_related_posts’)) { thumbnails_anywhere_for_related_posts();} ?>

放置位置:日志页模板(single.php)的任意位置。

5. 分类缩略图

代码:

<?php if(function_exists(‘thumbnails_anywhere_for_category’)) { thumbnails_anywhere_for_category(); } ?>

放置位置:分类页模板(通常是archive.php)的任意位置。【注意】:这里的分类缩略图是指将某个分类的图片集中放在一起显示,如果要在分类页实现类似首页缩略图的效果,请仍然使用thumbnails_anywhere_for_homepage的代码。

6.带参数的调用方式:

另外,插件提供了带参数的调用方式(不带参数时,采用后台设置):依次是数量num、宽度width、高度height。

随机缩略图:thumbnails_anywhere_for_random_posts(‘num=10&width=100&height=50′)

最新缩略图:thumbnails_anywhere_for_recent_posts(‘num=20&width=200&height=60′)

相关缩略图:thumbnails_anywhere_for_related_posts(‘num=30&width=150&height=70′)

分类缩略图:thumbnails_anywhere_for_category(5) 显示分类ID为5的缩略图,位置任意放置。你甚至可以做一个简单的分类相册。

下载地址:https://www.box.net/shared/vyxh8q36ja

随机日志

5条评论 »

评论 RSS Feed。 TrackBack URL

发表评论