[WordPress] 外掛分享: Get Image

首頁外掛目錄 › Get Image
20+
安裝啟用
尚無評分
6134 天前
最後更新
問題解決
WordPress 2.6+ v1.0 上架:2008-06-17

內容簡介

注意:此版本僅適用於 WordPress 2.6。如果您想在 WordPress 2.5 上使用,請在下載庫中獲取版本0.5。

取得文章中最後一個圖像。要使用此外掛,您只需在模板中插入以下命令之一:

gi_fullsize();
gi_medium();
gi_thumbnail();

通過添加參數,它將成為生成的img標籤。默認情況下,該外掛將返回包含圖像標籤的字符串,但您可以將第二個參數傳遞給true,以使此字符串印刷。

版本0.5 中更新的內容

現在您有一個gi_library()函數。它返回您文章中的所有圖像,而不僅僅是最後一個,您可以傳遞某些參數,例如:您想要的大小和返回類型。

gi_library()的大小為:'all','fullsize','medium','thumbnail'

版本0.8 中升級的內容

增加了gi_thumb()和gi_full()的快捷方式。

升級為 WordPress 2.6

在gi_library中添加了寬度和高度。

使用本機 wp_get_attachment_image() 函數。

版本0.9 中升級的內容

現在,gi_fullsize(),gi_full(),gi_medium(),gi_thumbnail()和gi_thumb()接收兩個參數。

第一個參數是$print,此參數打印返回,用於縮短您的呼叫。因此,如果您想打印,請勿使用:

<?php echo gi_full(); ?>

而使用以下方法:

<?php gi_full(1); ?>

第二個參數表示您要使用的圖像數量。此數字是圖庫中的圖像數字。下面的代碼以縮略圖格式打印圖庫中的第三個圖像。

<?php gi_thumb(true, 3); ?>

函數gi_library()為縮略圖和完整大小提供快捷方式。現在您可以在模板/腳本中使用gi_library('thumb')或gi_library('full')。

版本1.0 中的升級

gi_library() 函數現在在brute_array模式下返回圖像的post_ID,title,caption和description。(意即返回圖像相關資訊)

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Get Image」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Note: This version only works on WordPress 2.6. If you wants to use on wordpress 2.5, please get
the version 0.5 on download repository.
Take the last image daughter of a post. To use this plugin you just need to insert one of
the following commands in your template:

gi_fullsize ();
gi_medium ();
gi_thumbnail ();

Adding a parameter, it becames in the tag img generated. By default, the plugin will return
a string containing the tag of the image, but you can pass the second parameter to true to
make the impression of this string.
Updated in version 0.5
Now you have a gi_library () function. It returns all images from yout post – not only the
last daughter, where you can pass some parameters like size and type of return you wants.
The sizes of gi_library () are: ‘all’, ‘fullsize’, ‘medium’, ‘thumbnail’
Upgraded in version 0.8
Added shortcuts for gi_thumb () and gi_full().
Upgraded for wordpress 2.6
Added width and height in gi_library.
Using the native wp_get_attachment_image () function.
Upgraded in version 0.9
Now, gi_fullsize(), gi_full(), gi_medium(), gi_thumbnail() and gi_thumb() recives two parameters.
The first is $print, this param prints the return, use it to shorcur yours call. So, if you wants
to print do not use:

But use:

The second param says the number of image you want to use. This number is the number of image in
galery order. The next code prints the third image in galery on format thumbnail.

The function gi_library() have shortcuts for thumb and full sizes. Now you can use
gi_library(‘thumb’) or gi_library('full') in your templates/scripts.
Upgrated in version 1.0
Now the function gi_library() on mode brute_array returns the post_ID, title, caption and description
from the image.

文章
Filter
Mastodon