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

  1. By default, content within the showhide shortcode will be hidden.
  2. Example: [showhide]Press release content goes in here.[/showhide]
  3. Default Values: [showhide type="pressrelease" more_text="Show Press Release (%s More Words)" less_text="Hide Press Release (%s Less Words)" hidden="yes"]

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

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

  6. If you want to set the default visibility to display.

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

  8. 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.

<div id="pressrelease-link-1" class="sh-link pressrelease-link sh-hide">  
  <a href="#">  
    <span id="pressrelease-toggle-1">Show Press Release (4 More Words)</span>  
  </a>  
</div>  
<div id="pressrelease-content-1" class="sh-content pressrelease-content sh-hide" style="display: none;">Content</div>
  1. 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 { }

Build Status

Development

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

Translations

http://dev.wp-plugins.org/browser/wp-showhide/i18n/

Credits

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.

螢幕擷圖

  • Show More - Press Release
  • Hide More - Press Release
  • Editor - Short Code

常見問題集

N/A

使用者評論

2020 年 6 月 22 日
After hours searching for such a fonctionality, I endly found this. Simple and efficient. Thanks. Après des heures à chercher une solution, j'ai trouvé celle-ci. Simple et efficace. Bravo et merci.
2020 年 5 月 8 日
作者的意思可能是基于经典编辑器的HTML模式来自定义,实际上可以直接修改插件,将A标签替换为button并定制一个class,再全局内添加此class的CSS就可以使其拥有漂亮的按钮样式了。 此方法在古腾堡编辑器下也可以使用。
2020 年 4 月 29 日
Exactly what I was looking for, thanks!
2020 年 4 月 28 日
After hours of searching for a plugin to insert "read more" tag to use for page, this plugin has saved me from so much stress and disappointment after hours of trying everything on google search. Hope a little of my donation would help you carry on and maintain this plugin. Thanks
2020 年 2 月 23 日
For some reason, the plugin works only in posts and pages, and in the description of tags and categories - just the code itself shows. If anyone knows how to configure the plugin so that it works for any type of WordPress text, please respond!
閱讀全部 36 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈WP-ShowHide〉的開發相關工作。

參與者

WP-ShowHide 外掛目前已有 1 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將 WP-ShowHide 外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

Version 1.04

  • NEW: Added aria-hidden and aria-expanded to elements

Version 1.03

  • NEW: Added .sh-link and .sh-content as a standard class name on top of the type specific class name.
  • NEW: Added do_shortcode() to allow shortcode to be parsed within ShowHide

Version 1.02

  • FIXED: Some theme uses .hide as display: none and hence I have changed .show to .sh-show and .hide to .sh-hide to advoid conflicts.

Version 1.01

  • NEW: Added additional show or hide class to the link and content depending on the visiblity of the content to allow more precise CSS styling.

Version 1.00 (01-05-2011)

  • FIXED: Initial Release