开发者 | dartiss |
---|---|
更新时间 | 2017年11月19日 20:58 |
PHP版本: | 5.3 及以上 |
WordPress版本: | 4.9 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
simple-content-reveal
folder to your wp-content/plugins/
directory.Sorry, shortcodes within the hide/show text cannot be processed.
This will probably be if you are generating your output using the shortcode. Usually, JavaScript generating HTML will cause errors, so you can use CDATA instead to suppress this. However, WordPress (for fuzzy reasons) modifies the CDATA command so that it no longer works. However, this is under investigation and, it is hoped, will be fixed in WordPress in the future. When this happens I'll be able to update this plugin to use CDATA and to play nicely with validators.
Check in your Writing settings in Administration that you don't have "WordPress should correct invalidly nested XHTML automatically" ticked, otherwise WordPress may incorrectly attempt to "fix" the output of the plugin.
Using the URL parameter acr_state
you can re-display your page with all content hidden, revealed or with the plugin switched off. See Other Notes for further details.
Because quotes (single or double) are used to specify the shortcode parameter - in this case the heading - you can't then use them use them for the heading text. Well, you can - whichever one you use for your shortcode parameter, you can use the other within your heading. So, this is fine...
[reveal heading="<h2>%image% Some 'Blah' Content Below</h2>" id="id1"]Blah, blah, blah content here[reveal]
As is this...
[reveal heading='<h2>%image% Some "Blah" Content Below</h2>' id="id1"]Blah, blah, blah content here[reveal]
Alternatively, particularly if you want to use both quote types within your heading, you can use ASCII instead. For example...
[reveal heading="<h2>%image% \x27Single quotes\x27 \x22double quotes\x22</h2>" id="id1"]Blah, blah, blah content here[reveal]
See a full list of available ASCII codes.
wp_enqueue_script
to handle script in header