[WordPress] 外掛分享: Mini Loops

WordPress 外掛 Mini Loops 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Mini Loops」是 2011-05-25 上架。 目前已經下架不再更新,不建議安裝使用。
  • 目前有 1000 個安裝啟用數。
  • 上一次更新是 2021-06-16,距離現在已有 1417 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3.5 以上版本才可以安裝。
  • 有 15 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

trepmal |

外掛標籤

recent | thumbnail | most recent | recent posts | category posts |

內容簡介

迷你文章循環的外掛程式。

顯示最近的文章、分類文章等等。可以透過小工具、短代碼和樣板標籤來顯示。

開發現在正在GitHub Repo進行中。

選項解釋:

小工具顯示

標題:在側邊欄中顯示最近文章的外掛標題。預設:Recent Posts。

[miniloop title=”Recent Posts”]
get_miniloops( array(‘title’ => ‘Recent Posts’ ) );

標題 URL:標題應該鏈接到的頁面。預設:無。

[miniloop title_url=”/blog/”]
get_miniloops( array(‘title_url’ => ‘/blog/” ) );

建立查詢

文章數量:顯示的文章數量。預設:3。

[miniloop number_posts=3]
get_miniloops( array(‘number_posts’ => 3 ) );

文章偏移量:顯示列表前要跳過的文章數量。預設:0。

[miniloop post_offset=0]
get_miniloops( array(‘post_offset’ => 0 ) );

最大年齡:不要顯示 X 天前的文章。預設:0。

[miniloop maximum_age=0]
get_miniloops( array(‘maximum_age’ => 0 ) );

文章作者:獲取作者的文章。按 ID。預設:無。

[miniloop post_author=0]
get_miniloops( array(‘post_author’ => 0 ) );

文章類型:要顯示的文章類型。預設:文章。

[miniloop post_type=post]
get_miniloops( array(‘post_type’ => ‘post’ ) );

文章狀態:要顯示的文章狀態。主要用於顯示即將發布(未來)的文章。但可以創意地使用!預設:已發布。

[miniloop post_status=publish]
get_miniloops( array(‘post_status’ => ‘publish’ ) );

排序方式:顯示文章的順序。預設:按日期排序。

[miniloop order_by=date]
get_miniloops( array(‘order_by’ => ‘date’ ) );

順序:遞增(按標題排序)或遞減(按日期排序)順序顯示文章。預設:遞減。

[miniloop order=DESC]
get_miniloops( array(‘order’ => ‘DESC’ ) );

按 some_key 值進行排序(如果 some_key 的值是字串/單詞,則適用):
[miniloop order_by=meta_value order_meta_key=some_key]
get_miniloops( array(‘order_by’ => ‘meta_value’, ‘order_meta_key’ => ‘some_key’ ) );

按 some_key 的數值進行排序(如果 some_key 的值是數字/整數,則適用):
[miniloop order_by=meta_value_num order_meta_key=some_key]
get_miniloops( array(‘order_by’ => ‘meta_value_num’, ‘order_meta_key’ => ‘some_key’ ) );

反轉文章順序?也許你想顯示最近的三篇文章,但你想首先顯示那三篇文章中最舊的一篇文章。如果是這樣,請設為 1。預設:0。

[miniloop reverse_order=0]
get_miniloops( array(‘reverse_order’ => 0 ) );

洗牌文章順序?隨機重新排列相符的文章的順序。也許是以隨機順序顯示最近的五篇文章。預設:0。

[miniloop shuffle_order=0]
get_miniloops( array(‘shuffle_order’ => 0 ) );

忽略置頂文章?將置頂文章視為普通文章。我建議忽略,否則顯示的文章數可能會與您設定的數量不符。預設:0。

[miniloop ignore_sticky=0]
get_miniloops( array(‘ignore_sticky’ => 0 ) );

原文外掛簡介

Widget for mini post loops.
Show most recent posts, posts from categories, and more. Can be displayed via widgets, shortcodes, and template tags.
Development is now happening at the GitHub Repo
Explanation of options:
Widget Display
Title: Your recent posts widget’s title on your sidebar. Default: Recent Posts
[miniloop title=”Recent Posts”]
get_miniloops( array(‘title’ => ‘Recent Posts’ ) );
Title URL: The page the title should link to. Default: none
[miniloop title_url=”/blog/”]
get_miniloops( array(‘title_url’ => ‘/blog/” ) );
Building the Query
Number of Posts: Number of posts to be displayed. Default: 3
[miniloop number_posts=3]
get_miniloops( array(‘number_posts’ => 3 ) );
Post Offset: Number of posts to skip before displaying the list. Default: 0
[miniloop post_offset=0]
get_miniloops( array(‘post_offset’ => 0 ) );
Maximum Age: Don’t show posts more than X days old Default: 0
[miniloop maximum_age=0]
get_miniloops( array(‘maximum_age’ => 0 ) );
Post Author: Get author’s post. By ID. Default: none
[miniloop post_author=0]
get_miniloops( array(‘post_author’ => 0 ) );
Post Type: Post type to display. Default: post
[miniloop post_type=post]
get_miniloops( array(‘post_type’ => ‘post’ ) );
Post Status: Post status to display. Primarily useful to show upcoming (future) posts. But be creative! Default: publish
[miniloop post_status=publish]
get_miniloops( array(‘post_status’ => ‘publish’ ) );
Order By: What order the posts should be displayed in. Default: date
[miniloop order_by=date]
get_miniloops( array(‘order_by’ => ‘date’ ) );
Order: Ascending (good for order by title) or Descending (good for order by date) Default: DESC
[miniloop order=DESC]
get_miniloops( array(‘order’ => ‘DESC’ ) );
Ordering by the values of some_key (works well if the values of some_key are strings/words):
[miniloop order_by=meta_value order_meta_key=some_key]
get_miniloops( array(‘order_by’ => ‘meta_value’, ‘order_meta_key’ => ‘some_key’ ) );
Ordering by the numeric values of some_key (works well if the values of some_key are numbers/integers):
[miniloop order_by=meta_value_num order_meta_key=some_key]
get_miniloops( array(‘order_by’ => ‘meta_value_num’, ‘order_meta_key’ => ‘some_key’ ) );
Show posts in reverse order? Perhaps you want the 3 most recent posts, but you want the oldest of those to be displayed first. If so, check this. Default: 0
[miniloop reverse_order=0]
get_miniloops( array(‘reverse_order’ => 0 ) );
Shuffle post order? Shuffle the order of the posts matching your query. Perhaps showing the 5 most recent posts in randomized order. Default: 0
[miniloop shuffle_order=0]
get_miniloops( array(‘shuffle_order’ => 0 ) );
Ignore sticky posts? Treat sticky posts as normal posts. I recommend ignoring, or the number of posts displayed may be inconsistent. Default: 1
[miniloop ignore_sticky=1]
get_miniloops( array(‘ignore_sticky’ => 1 ) );
Exclude sticky posts? Don’t show sticky posts at all. Default: 0
[miniloop exclude_sticky=0]
get_miniloops( array(‘exclude_sticky’ => 0 ) );
Only sticky posts? Show only sticky posts. Default: 0
[miniloop only_sticky=0]
get_miniloops( array(‘only_sticky’ => 0 ) );
If viewing a single post, exclude it? If viewing a single post, remove it from the widget display. Default: 1
[miniloop exclude_current=1]
get_miniloops( array(‘exclude_current’ => 1 ) );
Get posts from current category (if archive)? If viewing an archive, only show posts from the same category. Default: 0
[miniloop current_category=1]
get_miniloops( array(‘current_category’ => 1 ) );
Get posts from first category (if single)? If viewing a single post, only show posts from the first category. Default: none
[miniloop current_single_category=1]
get_miniloops( array(‘current_single_category’ => 1 ) );
Get posts from current author (if single or archive)? Show more posts from the current author. Default: none
[miniloop current_author=1]
get_miniloops( array(‘current_author’ => 1 ) );
Categories: Comma separated list of category IDs to pull from. Use negative ID numbers to exclude a category. Default: none
[miniloop categories=”1,8,13″]
get_miniloops( array(‘categories’ => ‘1,8,13’ ) );
Tags: Comma separated list of tag IDs to pull from. Use negative ID numbers to exclude a tag. Default: none
[miniloop tags=”15,40,88″]
get_miniloops( array(‘tags’ => ‘15,40,88’ ) );
Custom Taxonomies: A clunky way to support custom taxonomies. Default: none. To include terms 5, 6, 9 from taxonomy “Genre” do this:
[miniloop tax=”genre=5,6,9″]
get_miniloops( array(‘tax’ => ‘genre=5,6,9’ ) );
Custom Fields: For listing posts that have certain meta data. Default: none. To list posts that have a custom field ‘favorite_color’ with a value of ‘blue’ do this:
[miniloop custom_fields=”favorite_color=blue”]
get_miniloops( array(‘custom_fields’ => ‘favorite_color=blue’ ) );
Exclude Posts: A comma separated list of post IDs to exclude. Default: none
[miniloop exclude=”15,200,1032″]
get_miniloops( array(‘exclude’ => ‘15,200,1032’ ) );
Display
Before Items: Text/HTML to insert before the post list. Default:

    [miniloop before_items=””]
    get_miniloops( array(‘before_items’ => ” ) );
    After Items: Text/HTML to insert after the post list. Default:

[miniloop after_items=””]
get_miniloops( array(‘after_items’ => ” ) );
Item Format:
HTML and shortcodes to format each item
Shortcodes

[ml_title]
[ml_url]
[ml_excerpt] Attributes: length (100), wlength (0), after (‘…’), space_between (0), after_link (1), custom (0), strip_tags (1), strip_shortcodes (1)

length = excerpt length in characters (0 for none, -1 for full length)
wlength = excerpt length in words
after = what to show after the excerpt
space_between = force space between excerpt and ‘after’
after_link = make the ‘after’ link to the post
custom = 1 to default/customized excerpts, 0 to trim by lentgh
strip_tags = 1 to strip HTML tags, 0 to keep. CAREFUL: it is not generally recommended to keep the tags. Character excerpts may break tags, and thus break an entire page’s layout.
strip_shortcodes = 1 to strip shortcodes, 0 to keep
up_to_more = 1 to get everything up to the tag (the ‘more’ text), if it exists, otherwise use char/word limit excerpt. 0 use char/word limited excerpt
after_with_more = (with up_to_more) 1 to use the ‘after’ text with the ‘more’ text, 0 to add nothing after the ‘more’ text

[ml_content]
[ml_comment_count]
[ml_author]
[ml_author_link]
[ml_author_avatar] Attributes: size (92), default (”), alt (false)

size = avatar size, in pixels
default = default if no gravatar. See Settings > Discussion
alt = alt text

[ml_field] Attributes: name, single (1), separator (‘, ‘), reverse (0)

name = custom field name
single = 1 get single value, 0 get all values matching name
separator = string to separate each value
reverse = 0 default order, 1 reverse display order

[ml_taxonomy] Attributes: taxonomy, separator (‘, ‘), link (0), justone (0), reverse (0)

taxonomy = taxonomy slug
separator = string to separate each term
link = 1 to link categories to their archive page, 0 for no links
justone = 1 to show just first category, 0 to show all
reverse = 0 default order, 1 reverse display order

[ml_tax] Alias to [ml_taxonomy]
[ml_category] Shortcut for [tax taxonomy=category]
[ml_tag] Shortcut for [tax taxonomy=post_tag]
[ml_date] Attributes: format (‘F j, Y’)

format = PHP-style date format

[ml_class] Attributes: class

class = classes to display in addition to the traditional post classes

[ml_image] Attributes: from, cfname, class, width (50), height (50), crop, fallback

from (options: thumb, attached, customfield, first)

from ‘thumb’ post thumbnail/featured image [ml_image from=thumb]
from ‘attached’ first attached image [ml_image from=attached]
from ‘customfield’ get from custom field [ml_image from=customfield]
from ‘first’ first image in post [ml_image from=first]

since 1.1.3, you can pass a comma-separated list to use as fallbacks. [ml_image from="thumb,first"]
cfname = custom field to use if from=customfield [ml_image from=customfield cfname=thumbnail]
class = class for image
width = width of image
height = height of image
crop = 1 to crop, 0 to scale (not implemented yet)
fallback = URL of image to use if ‘from’ doesn’t return anything
cache = set to ‘clear’ to generate new thumbnails. It is not recommended that you leave this option on. [ml_image from=thumb cache=clear]

Inside of Item Format, shortcodes can be used without the ml_ prefix.
Sample Item Formats
Format 1: https://s.w.org/extend/plugins/mini-loops/screenshot-2.png
(before:

    after:

)

[image from=customfield
cfname=image width=50 height=50 class=alignright
fallback=’http://dummyimage.com/50′][title]
[excerpt wlength=30 space_between=1 after=”…” after_link=1]
By [author] on [date format=”n/j/y”]

Format 2: https://s.w.org/extend/plugins/mini-loops/screenshot-3.png
(before:

    after:

)

[date format=”F j, Y”]
[image from=customfield cfname=image width=180 height=100
class=aligncenter fallback=’http://placekitten.com/180/100′]
[excerpt length=90 space_between=1 after=”…” after_link=1]

Format 3: https://s.w.org/extend/plugins/mini-loops/screenshot-4.png
(before: — after: –)
[title]
[image from=customfield cfname=image width=140 height=140
class=aligncenter fallback=’http://placepuppy.it/200/300&text=++woof++’]
Template Tag
use miniloops( $args ) or get_miniloops( $args )
Like WordPress function, the ‘get_’ variant will simply return the results.
Here are the acceptable arguments and their default values:
$args = array(
'title' => __( 'Recent Posts', 'mini-loops' ),
'hide_title' => 0,
'title_url' => '',
'number_posts' => 3,
'post_offset' => 0,
'post_type' => 'post',
'post_status' => 'publish',
'order_by' => 'date',
'order' => 'DESC',
'reverse_order' => 0,
'shuffle_order' => 0,
'ignore_sticky' => 1,
'only_sticky' => 0,
'exclude_current' => 1,
'categories' => '',
'tags' => '',
'tax' => '',
'custom_fields' => '',
'exclude' => '',
'before_items' => '

    ',
    'item_format' => '
  • [title]
    [excerpt]
  • ',
    'after_items' => '

',
);
get_miniloops( $args );

Shortcode
[miniloop]

Use with all args listed above
e.g. [miniloop number_posts=10]
Exception – ‘item_format’ must be handled differently
New way (since v0.9):
Create a custom field named ml_format and save the item format there. Then adjust your [miniloop] shortcode
e.g. [miniloop number_posts=10][ml_format][/miniloop]
If needed, you can change the custom field. Just pass the name of the new custom field to the [ml_format] shortcode
e.g. [miniloop number_posts=10][ml_format name="new_field"][/miniloop]
Old way:
‘item_format’ must go into the content of the shortcode, and square brackets must be replaced with curly brackets.
e.g. [miniloop number_posts=10]{title}by {author}
[/miniloop]
Also, if you are using html inside the item_format, you must add this into the HTML editor, else your markup will be rendered, not parsed
Planned

true image cropping for remote images

Other Languages

French (Thanks @maoneetag)

Bilingual?
Send your mo/po files to me at trepmal (at) gmail.com

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Mini Loops」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1.0 | 1.1 | 1.2 | 1.3 | 1.4 | 1.0.1 | 1.1.1 | 1.1.2 | 1.3.1 | 1.4.1 | trunk |

延伸相關外掛(你可能也想知道)

  • Regenerate Thumbnails 》重新生成縮略圖插件可以讓您為已上傳到媒體庫的一個或多個圖像重新生成所有縮略圖大小。, 這對以下情況很有用:, , 您新增了新的縮略圖大小,並且您希望過去...。
  • Force Regenerate Thumbnails 》『Force Regenerate Thumbnails』可以讓您刪除所有舊圖像大小,並確實重新生成上傳圖像的縮略圖。, 在「工具」管理員選單中從頭開始生成所有縮略圖,或透過媒...。
  • Perfect Images 》使用 Perfect Images,輕鬆掌握您的圖像!這個強大的外掛可助您進行圖像優化和管理,輕鬆替換或批量重新生成現有圖像,設置自定義尺寸,提高性能,並為高質量...。
  • AJAX Thumbnail Rebuild 》AJAX Thumbnail Rebuild 可讓您重新建立網站上的所有縮圖。儘管已經有一些插件可供使用,但它們有一個共同點:所有縮圖都會在單一步驟中重新建立。如果您的網...。
  • XO Featured Image Tools 》此外掛可以自動從文章中的圖片產生特色圖片。, 功能, , 一次性產生所有文章的特色圖片。, 在儲存文章時自動產生特色圖片。, 批次刪除文章的特色圖片。, 於文...。
  • Conditionally display featured image on singular posts and pages 》注意事項, 如果你的佈景主題使用自訂調用來載入特色圖片(如 Twenty Seventeen 主題),則本外掛可能無法運作!請使用 get_the_post_thumbnail()、wp_get_att...。
  • Featured Image Admin Thumb 》啟用此外掛後,它會在「所有文章/所有頁面」及支援的所有自訂文章類型管理介面中新增一欄,名為「Thumb」。這一欄會顯示文章特色圖片或者是文章縮圖的縮略圖...。
  • Videopack 》一個外掛,用於製作視頻播放器、縮略圖、多個分辨率和視頻庫。, 這個視頻外掛可以將各種選項添加到上傳到 WordPress 媒體庫的任何視頻。如果您的瀏覽器原生支...。
  • PDF Image Generator 》這個外掛可以透過上傳 PDF 附件,將封面轉換為 JPEG,並作為文章縮略圖檔案附加。它還允許顯示縮略圖標誌和插入 PDF 鏈接與封面圖像到編輯器。, , 僅支援 Wor...。
  • Manual Image Crop 》此外掛允許您手動裁剪 WordPress 佈景主題中註冊的所有圖片尺寸(特別是特色圖片)。, 只需點擊您媒體庫中任何圖片旁邊的“裁剪”連結。, 將顯示...。
  • Kama Thumbnail 》這個外掛可以方便地在不增加負擔的情況下即時建立文章縮圖,是 "thumbnail.php" 腳本的最佳替代品。, 支援多站點。, 使用方法, 這是針對開發人員的外掛,安裝...。
  • Get the Image 》「Get the Image」是 WordPress 中最先進的縮略圖 / 圖片外掛之一。, 從小型博客到大型企業級解決方案 (如WordPress.com VIP),此插件適合所有人使用。它之所...。
  • Easy Add Thumbnail 》註: 此外掛功能由超過 10,000 個活躍的安裝保證。但在安裝此外掛之前請注意,它的唯一目的是將功能影像識別碼 (使用 WP 編輯器相同的方式) 添加到您的文章中...。
  • Document Gallery 》這個外掛可讓使用者毫不費力地建立文件和其他附加媒體的圖庫,就像現有的圖像附件圖庫選項一樣。, 觀看以下視頻以瞭解 Document Gallery 如何運作:, , 在設...。
  • Advanced Random Posts Widget 》注意事項, 此外掛已不再支援,請使用 Recent posts widget Extended 取代。, 此外掛提供更彈性和進階的隨機文章列表功能。您可以透過縮略圖、摘要和文章日期...。

文章
Filter
Mastodon