
內容簡介
預設情況下,內容是隱藏的,使用者必須點擊「顯示內容」連結來切換內容。與 Engadget 為他們的新聞稿所做的方式相似。範例用法:[showhide type="pressrelease"]新聞稿在這裡。[/showhide]
使用方式
預設情況下,showhide 短碼內的內容將被隱藏。
範例:[showhide]新聞稿內容在這裡。[/showhide]
預設值:[showhide type="pressrelease" more_text="顯示新聞稿 (%s 更多字)" less_text="隱藏新聞稿 (%s 較少字)" hidden="yes"]
您可以在文章或頁面中擁有多個 showhide 內容,只需有一個新類型即可。
範例:[showhide type="links" more_text="顯示連結 (%s 更多字)" less_text="隱藏連結 (%s 較少字)"]連結會在這裡。[/showhide]
如果您想將預設可見度設置為顯示。
範例:[showhide hidden="no"]新聞稿內容在這裡。[/showhide]
您可以通過插件生成的 CSS 樣式來設計內容。以下是生成的 HTML 的樣例。請注意,pressrelease 是默認類型。
<div id="pressrelease-link-1" class="sh-link pressrelease-link sh-hide">
<a href="#">
<span id="pressrelease-toggle-1">顯示新聞稿 (4更多字)</span>
</a>
</div>
<div id="pressrelease-content-1" class="sh-content pressrelease-content sh-hide" style="display: none;">內容</div>
使用上面的範例,您可以在 CSS 中使用以下樣式:
.sh-link A { }
.sh-content { }
.pressrelease-link { }
.pressrelease-link.sh-hide A { }
.pressrelease-link.sh-show A { }
.pressrelease-content { }
.pressrelease-content.sh-hide { }
.pressrelease-content.sh-show { }
開發
https://github.com/lesterchan/wp-showhide
翻譯
http://dev.wp-plugins.org/browser/wp-showhide/i18n/
製作人員
外掛圖標由 Freepik 提供,來源為 Flaticon
捐贈
我大部分的空閒時間都是用來製作、更新、維護和支援這些外掛程式,如果您真的喜歡我的外掛程式並且能夠幫我省下幾個錢,我真的會感激不盡。如果不行,請隨意使用。
外掛標籤
開發者團隊
原文外掛簡介
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 A { }
.sh-content { }
.pressrelease-link { }
.pressrelease-link.sh-hide A { }
.pressrelease-link.sh-show A { }
.pressrelease-content { }
.pressrelease-content.sh-hide { }
.pressrelease-content.sh-show { }
Development
https://github.com/lesterchan/wp-showhide
Translations
http://dev.wp-plugins.org/browser/wp-showhide/i18n/
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.
