国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > Wordpress > 正文

縮略圖插件WP-Thumbnails 代碼調用

2024-09-07 00:51:08
字體:
來源:轉載
供稿:網友

頁面縮略圖:

<?php if(function_exists('wp_thumbnails_for_homepage')) { wp_thumbnails_for_homepage('width=120&height=100'); } ?>

隨機文章縮略圖:

<?php if(function_exists('wp_thumbnails_for_random_posts')) { wp_thumbnails_for_random_posts('num=10&width=75&height=75'); } ?>

最新文章縮略圖:

<?php if(function_exists('wp_thumbnails_for_recent_posts')) { wp_thumbnails_for_recent_posts('num=20&width=100&height=100'); } ?>

相關文章縮略圖:

<?php if(function_exists('wp_thumbnails_for_related_posts')) { wp_thumbnails_for_related_posts('num=30&width=150&height=75'); } ?>

最熱門文章縮略圖,下面代碼最后兩個參數表示只顯示視頻,并且直接顯示視頻而不是視頻中的縮略圖.

<?php if(function_exists('wp_thumbnails_for_popular_posts')) { wp_thumbnails_for_popular_posts('num=100&width=150&height=75&media=video&thumb=video'); } ?>

全排列縮略圖:

<?php if(function_exists('wp_thumbnails_for_single_post')) { wp_thumbnails_for_single_post('num=9&width=75&height=75'); } ?>

指定分類下的文章縮略圖:

<?php if(function_exists('wp_thumbnails_for_category')) { wp_thumbnails_for_category('id=5&num=10&width=180&height=75&order=recent'); } ?>

指定標簽下的文章縮略圖:

<?php if(function_exists('wp_thumbnails_for_tag')) { wp_thumbnails_for_tag('id=4,5,6,7&num=10&width=180&height=75&order=random'); } ?>

短代碼調用方式:

WordPress提供了短代碼(short code),將短代碼插入文章內部后,WordPress會自動處理短代碼來實現相關功能。WP-Thumbnails也支持通過短代碼讓您在文章任何位置顯示縮略圖。短代碼僅適用于各種“文章縮略圖”。

比如下面的例子。請注意:短代碼用中括號[ ]包起來。正式使用時,務必將下面例子中的【】替換成[ ]

隨機文章縮略圖:【wp-thumbnails type="random"width="75" height="75"】

最新文章縮略圖:【wp-thumbnails type="recent"num="20" width="100" height="100"】

相關文章縮略圖:【wp-thumbnails type="related"num="30" width="150" height="75"】

最熱門文章縮略圖:【wp-thumbnails type="popular"num="100" width="150" height="75"media="video" thumb="video"】

全排列縮略圖:【wp-thumbnails type="single"num="9" width="75" height="75"】

指定分類下的文章縮略圖:【wp-thumbnails type="category"id="5" num="10" width="180" height="75"order="recent"】

指定標簽下的文章縮略圖:【wp-thumbnails type="tag"num="10"  id="4,5,6,7" width="180"height="75" order="random"】

我想你已經很清楚了:短代碼用中括號[ ]包起來,短代碼的名稱必須為wp-thumbnails,短代碼必須指定是哪種類型(type)的文章縮略圖(有random、recent、popular、related、single、category、tag)。

短代碼中其他的參數都是可選的,這些參數和上面“帶參數的調用方式”中提到的參數是完全一樣的。參數之間用空格隔開,參數值用英文雙引號""包圍起來,各個參數的先后順序是任意的。

沒有指定的參數則采用后臺相應的設置.

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 湘西| 错那县| 鄂尔多斯市| 湟中县| 平山县| 洞头县| 怀宁县| 沙坪坝区| 南召县| 崇左市| 阳泉市| 汶川县| 木里| 绵竹市| 涡阳县| 恩施市| 广宗县| 冀州市| 泽州县| 内江市| 平度市| 扎赉特旗| 饶阳县| 东阿县| 水富县| 盐山县| 贵州省| 孟村| 霸州市| 大名县| 桦川县| 景德镇市| 石景山区| 淄博市| 忻州市| 综艺| 新平| 四平市| 丰城市| 府谷县| 三原县|