
內容簡介
此外掛提供一個自訂文章類型,可挑選圖片與內容,並使用短碼 [sx-carousel] 從 Twitter Bootstrap 產生一個 carousel。
本外掛假設已經使用 Bootstrap,因此需要單獨載入 Bootstrap Javascript 和 CSS。
下載 Twitter Bootstrap
查看 Bootstrap Carousel 的效果
如果您想參與此外掛的貢獻,可以在 GitHub 上找到它。
短碼選項
如果您需要不同的設置來製作不同的 Carousel,可以使用以下短碼選項來覆寫默認值…
interval(預設為 5000)
標題在每張圖片上暫停的時間長度,單位為毫秒。
[sx-carousel interval=”12000″]
showcaption(預設為 true)
是否顯示每張圖片上的文本標題,是為 true,否為 false。
[sx-carousel showcaption=”false”]
showcontrols(預設為 true)
是否顯示控制箭頭,是為 true,否為 false。
[sx-carousel showcontrols=”false”]
orderby 和 order(預設為 menu_order 和 ASC)
如何顯示文章的順序,使用 WP_Query terms。
[sx-carousel orderby=”rand”]
[sx-carousel orderby=”date” orderby=”DESC”]
category(預設為全部)
使用逗號分隔的 Carousel 分類名稱篩選 Carousel。
[sx-carousel category=”homepage,highlights”]
id(預設為全部)
指定要顯示的特定 Carousel 文章的 ID,僅顯示一張圖片。
通過查看編輯文章鏈結獲取圖片的 ID,例如,文章 109 將是 /wp-admin/post.php?post=109&action=edit
[sx-carousel id=”109″]
twbs(預設為 2)
為 Twitter Bootstrap 版本 2 或版本 3 輸出標記。
[sx-carousel twbs=”3″]
貢獻
如果您想為此外掛貢獻力量,請前往 GitHub 存儲庫,對開發版本進行個人分叉(fork)。您可以進行更改,然後提交拉取請求。我很樂意審查代碼,當我們都滿意時,我們將合並代碼。您可以在此處閱讀更多詳細信息。
外掛標籤
開發者團隊
原文外掛簡介
A custom post type for choosing images and content which outputs a carousel from Twitter Bootstrap using the shortcode [sx-carousel].
The plugin assumes that you’re already using Bootstrap, so you need to load the Bootstrap javascript and CSS separately.
Download Twitter Bootstrap
Bootstrap Carousel in action
If you’d like to contribute to this plugin, you can find it hosted on GitHub.
Shortcode Options
If you’d like different settings for different carousels, you can override these by using shortcode options…
interval (default 5000)
Length of time for the caption to pause on each image. Time in milliseconds.
[sx-carousel interval=”12000″]
showcaption (default true)
Whether to display the text caption on each image or not. true or false.
[sx-carousel showcaption=”false”]
showcontrols (default true)
Whether to display the control arrows or not. true or false.
[sx-carousel showcontrols=”false”]
orderby and order (default menu_order ASC)
What order to display the posts in. Uses WP_Query terms.
[sx-carousel orderby=”rand”]
[sx-carousel orderby=”date” orderby=”DESC”]
category (default all)
Filter carousel items by a comma separated list of carousel category slugs.
[sx-carousel category=”homepage,highlights”]
id (default all)
Specify the ID of a specific carousel post to display only one image.
Find the image ID by looking at the edit post link, eg. post 109 would be /wp-admin/post.php?post=109&action=edit
[sx-carousel id=”109″]
twbs (default 2)
Output markup for Twitter Bootstrap Version 2 or 3.
[sx-carousel twbs=”3″]
Contributing
If you would like to contribute to this plugin, please go to the GitHub repository and make a personal fork of the development version. You can then make your changes and submit a pull request. I will happily review the code and then merge when we’re both happy. You can read more details here.
