[WordPress] 外掛分享: WP Lipsum

首頁外掛目錄 › WP Lipsum
WordPress 外掛 WP Lipsum 的封面圖片
10+
安裝啟用
☆☆☆☆
1/5 分(1 則評價)
5064 天前
最後更新
問題解決
WordPress 3.3.2+ v1.4 上架:2012-05-01

內容簡介

WP-Lipsum 包含了一系列模板片段,代表了許多常見的頁面類型,從簡單的 lorem ipsum 段落到 WP 評論系統的演示,以及更多。它通過簡單的 shortcode 或模板標記來使用。

使用 Shortcode
[lipsum]

這會輸出基本內容區塊。您可以在 wp-lipsum/templates/basic.php 中編輯這個區塊。

[lipsum template=aux]

這會輸出輔助 lipsum 頁面,包括表格、定義列表等。您可以在 templates/aux.php 中編輯這個頁面。

[lipsum repeat=4]

這會輸出 4 個簡單的 lorem ipsum 段落。您可以在 templates/p.php 中編輯這些內容。

[lipsum template=ol repeat=3]

這會載入有序列表模板並顯示它 3 次。

[lipsum t=ol r=3]

您還可以使用 “t” 和 “r” 作為參數快捷方式。

Lipsum 模板和片段

這裡列出了可用的所有 lipsum 內容頁面:

基本內容 - "basic"
輔助內容 - "aux"
博客演示 - "blog"
單篇文章演示 - "single"
標題列表 - "headline_list"
圖庫演示 - "gallery"
作品集示範 - "portfolio"
長標題範例 - "long_headers"
簡短內容演示 - "short"
模板片段

您還可以調用這些更小的片段,並使用 “repeat” 參數:

單段落 - "p"
無序列表 - "ul"
有序列表 - "ol"
定義列表 - "dl"
表格範例 - "table"
引用區塊 - "blockquote"
博客摘要 - "blog_teaser"
圖片(沒有標題)- "img"
帶有 WP 標題的圖片 - "caption"
代碼演示 - "code"
評論演示 - "comments"
圖庫項目 - "gallery_item"
標題列表 - "headers"
標題摘要 - "headline_teaser"
其他內容 - "misc"
作品集項目 - "portfolio_item"

所有 lipsum 模板片段都位於 plugins/wp-lipsum/templates。您可以很容易地在這裡添加新的模板文件,並使用“template”屬性調用它們。

模板使用 Bedrock 慣例,包括類名(例如 .table-style 和 .post-nav)、僅使用 H1 和 H2 作為標題,以及其他概念。

圖片尺寸

對於圖片模板,您也可以使用“寬度”、“高度”和“對齊”參數(快捷方式 w、h 和 a)傳遞自定義尺寸。這適用於 img、caption、portfolio & portfolio_item、gallery & gallery_item 模板。

[lipsum template=img width=300 height=150]

[lipsum t=caption w=300 h=150 a=right]

[lipsum t=gallery w=500 h=220]

[lipsum t=portfolio w=100 h=100]

對齊可以設置為“left”、“right”、“center”或“none”。這些參數的預設值為 200×200,並且居左對齊。

使用模板標記

您還可以通過使用 display_lipsum_template() 函數從主題代碼中調用插件:

<?php display_lipsum_template($template, $repeat); ?>
<?php display_lipsum_template('basic') ?>
<?php display_lipsum_template('table', 4) ?>
<?php display_lipsum_template('caption', 1,

外掛標籤

開發者團隊

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

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「WP Lipsum」→ 直接安裝(推薦)

原文外掛簡介

WP-Lipsum includes a collection of template fragments representing lots of common page types, from simple lorem ipsum paragraphs to demos of the WP comment system, and more. It works via a simple shortcode or template tag.
Using the Shortcode
[lipsum]

This outputs the basic content block. You can edit this in wp-lipsum/templates/basic.php.
[lipsum template=aux]

This outputs the auxilary lipsum page, with tables, definition lists, and more. You can edit this in templates/aux.php.
[lipsum repeat=4]

This outputs 4 simple paragphs of lorem ipsum text. You can edit the text in templates/p.php.
[lipsum template=ol repeat=3]

This loads the ordered list template and displays it 3 times.
[lipsum t=ol r=3]

You can also use “t” and “r” as parameter shortcuts.
Lipsum Templates and Fragments
Here are the full pages of lipsum content available:

Basic Content – “basic”
Aux Content – “aux”
Blog Demo – “blog”
Single Post Demo – “single”
Headline List – “headline_list”
Gallery Demo – “gallery”
Portfolio Demo – “portfolio”
Long Header Examples – “long_headers”
Short Content Demo – “short”
Template Fragments

You can also call these smaller fragments, and use the “repeat” parameter:

Single Paragraph – “p”
Unordered List – “ul”
Ordered List – “ol”
Definition List – “dl”
Table Example – “table”
Blockquote – “blockquote”
Blog Teaser – “blog_teaser”
Image (without caption) – “img”
Image with WP Caption – “caption”
Code Demo – “code”
Comments Demo – “comments”
Gallery Item – “gallery_item”
List of Headers – “headers”
Headline Teaser – “headline_teaser”
Misc Content – “misc”
Portfolio Item – “portfolio_item”

All lipsum template snippets are located in plugins/wp-lipsum/templates. You can easily add new template files in here, and call them with the “template” attribute.
Templates use Bedrock conventions, including class names (like .table-style and .post-nav), using H1s and H2s only for titles, and other concepts.
Image Dimensions
For the image templates, you can also pass in custom dimensions with the “width”, “height” and “align” parameters (shorcuts w, h and a). This works for the img, caption, portfolio & portfolio_item, and gallery & gallery_item templates.
[lipsum template=img width=300 height=150]

[lipsum t=caption w=300 h=150 a=right]

[lipsum t=gallery w=500 h=220]

[lipsum t=portfolio w=100 h=100]

Align can be set to “left”, “right”, “center” or “none”. These parameters default to 200×200, and alignleft.
Using the Template Tag
You can also call the plugin from your theme code, by using the display_lipsum_template() function:



More Info
View the WP-Lipsum homepage here
WP-Lipsum is a part of the Bedrock mini-framework, more info at bedrocktheme.com
Follow me at dylanized.com and @dylanized

延伸相關外掛

文章
Filter
Apply Filters
Mastodon