[WordPress] 外掛分享: WP-ShowHide

首頁外掛目錄 › WP-ShowHide
WordPress 外掛 WP-ShowHide 的封面圖片
9,000+
安裝啟用
★★★★
4.2/5 分(43 則評價)
7 天前
最後更新
問題解決
WordPress 4.6+ PHP 7.4+ v2.0.0 上架:2011-04-27

內容簡介

WP-ShowHide 外掛允許使用者在文章或頁面中隱藏內容,並透過點擊連結來顯示或隱藏該內容,類似於 Engadget 的新聞稿格式。此外掛提供簡單的短碼使用方式,讓內容顯示更具互動性。

【主要功能】
• 隱藏與顯示內容的短碼功能
• 支援多種內容類型的顯示
• 可自訂顯示與隱藏的文字
• 提供 CSS 樣式自訂功能
• 預設內容隱藏選項

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.0.0) 或搜尋安裝

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

原文外掛簡介

By default the content is hidden and user will have to click on the “Show Content” link to toggle it. Similar to what Engadget is doing for their press releases. Example usage: [showhide type="pressrelease"]Press Release goes in here.[/showhide]
Usage

By default, content within the showhide shortcode will be hidden.
Example: [showhide]Press release content goes in here.[/showhide]

Default Values: [showhide type="pressrelease" more_text="Show Press Release (%s More Words)" less_text="Hide Press Release (%s Less Words)" hidden="yes"]

You can have multiple showhide content within a post or a page, just by having a new type.

Example: [showhide type="links" more_text="Show Links (%s More Words)" less_text="Hide Links (%s Less Words)"]Links will go in here.[/showhide]

If you want to set the default visibility to display.

Example: [showhide hidden="no"]Press release content goes in here.[/showhide]

You can style the content via CSS that is generated by the plugin. Here is a sample of the generated HTML. Note that pressrelease is the default type.

With the example above, here are the following styles you can use in your CSS:

.sh-link { }
.sh-toggle { }
.sh-content { }
.pressrelease-link { }
.pressrelease-link.sh-hide .sh-toggle { }
.pressrelease-link.sh-show .sh-toggle { }
.pressrelease-content { }
.pressrelease-content.sh-hide { }
.pressrelease-content.sh-show { }

Development
https://github.com/lesterchan/wp-showhide
Credits

Plugin icon by Freepik from Flaticon

Donations
I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks, I will really appreciate it. If not feel free to use it without any obligations.
Breaking Changes
Version 2.0.0 rewrites the front-end JavaScript. The shortcode and its attributes are unchanged, so your posts do not need editing — but the generated HTML is different, so custom CSS and JavaScript may need updating.

The toggle is now a

文章
Filter
Apply Filters
Mastodon