Artiss Content Reveal allows you to easily hide and reveal WordPress content, whether it's in the sidebar or in a post or page.
For those with access to their theme PHP, a function calls adds total flexibility as it can be added anywhere within your theme.
You need to add a call to the relevant function twice - one before the content that you wish to hide/reveal and then again at the end of the content. You only specify parameters for the first one.
<?php content_reveal( heading, id, default, imageurl, extension, cookie, title1, title2 ); ?>
Where...
%image% within the heading, where you wish it to appear. A default button is included with the plugin, but this can be overridden using further parameters. Additionally, if you wish the heading text to change as the content is hidden or revealed then you can specify the title text as %title%. There are 2 further parameters where you then specify the 2 pieces of text.hide or show to indicate (default is hide).Only the first parameter is required.
So, for example...
<?php content_reveal( '<h2>%image% Some Blah Content Below</h2>', 'id1' ); ?>Blah, blah, blah content here<?php content_reveal(); ?>
This will display a heading, complete with image and hide the content below it (between the two function calls). It has been given an ID of id1.
The following shows the title being modified...
<?php content_reveal( '<h2>%image% %title%</h2>', 'id1', '', '', '', '', 'Click to reveal', 'Click to hide' ); ?>Blah, blah, blah content here<?php content_reveal(); ?>
Plugin Checking - Please Note If you place a plugin check around your function calls, bear in mind that you will need to output the heading (if appropriate) if the function doesn't exist. So, using the example above you'd need to do this...
<?php if ( function_exists( 'content_reveal' ) ) { content_reveal( '<h2>%image% Some Blah Content Below</h2>', 'id1' ); } else { echo '<h2>Some Blah Content Below</h2>'; } ?>
Blah, blah, blah content here
<?php if ( function_exists( 'content_reveal' ) ) { content_reveal(); } ?>
This is used just like the function call and has the same parameters - the short code is [reveal]. You can either use the start and end shortcode method or, like the function call, you can simply use the same short code twice to encapsulate the content, only specifying parameters for the second one.
So, here's the previous example as a short code...
[reveal heading="<h2>%image% Some Blah Content Below</h2>" id="id1"]Blah, blah, blah content here[reveal]
Or you can specify it as...
[reveal heading="<h2>%image% Some Blah Content Below</h2>" id="id1"]Blah, blah, blah content here[/reveal]
Important: Make sure you add this using the html/code editor in WordPress, not the visual editor. In new versions of WordPress, just click the 'html' button above the edit box. If you use the visual editor it will not work, as the actual code you entered will be seen on the page, instead of being processed by the script.
For help with this plugin, or simply to comment or get in touch, please read the appropriate section in "Other Notes" for details. This plugin, and all support, is supplied for free, but donations are always welcome.
If you wish to show the title separately from the hidden/reveal text then an alternative function and shortcode is available. Both the function call and the shortcode is named reveal_link. It uses the same parameters as before.
To get this to work you must specify your text as usual BUT give it a heading of "noheading". For example...
[reveal heading="noheading" id="id1"]Blah, blah, blah content here[/reveal]
[reveal_link heading="<h2>%image% Some Blah Content Below</h2>" id="id1"]
This is the same example as previously uses BUT the text to hide/reveal appears BEFORE the title.
In previous use the ID does not need to be specified - if it isn't, one will be generated automatically. However, for this method to use both IDs must match and, hence, you must specify them.
Note: WordPress does not support square brackets in shortcode parameters so you cannot, for instance, use square brackets in the title when using the shortcode option. This is a limitation of WordPress and not this plugin.
A URL parameter named acr_state can be used to override all content on the page which uses this plugin. There are 3 possible values - show, hide or off. The latter will cause the plugin to output as if it wasn't active - all content will be shown and toggle images will be suppressed.
A JavaScript cookie can be used to remember the last state a user had some content in. This option is switched off by default.
In the Administration menu you should now find a new option under "Settings" named "Content Reveal". Within here you can switch the cookies on and state how long they should be stored for.
Additionally, you can control cookies on a case-by-case basis via a new parameter named cookie. The value should be set to the number of hours you wish the state to be stored for. To switch cookies off, specify this as zero. For example, with the shortcode you may put...
[reveal heading="<h2>%image% Some Blah Content Below</h2>" id="id1" cookie="3"]Blah, blah, blah content here[reveal]
This would save the cookie for 3 hours.
To assist with recent ICO regulation in the UK with regard to cookies a number of additional features exist...
acr_cookies= to the URL, followed by the number of hours (0 to switch off). e.g. for my site a URL of artiss.co.uk?acr_cookies=0 would cause all the current user's cookies for this plugin to be deleted[acr_cookies] exists. An example of output may be 7 daysThe cookie is named content_reveal_x, where x is the ID of the given content section.
This WordPress plugin is licensed under the GPLv2 (or later).
All of my plugins are supported via my website.
Please feel free to visit the site for plugin updates and development news - either visit the site regularly or follow me on Twitter (@artiss_tech).
For problems, suggestions or enhancements for this plugin, there is a dedicated page and a forum. The dedicated page will also list any known issues and planned enhancements.
Alternatively, please contact me directly.
This plugin, and all support, is supplied for free, but donations are always welcome.
Using Simple Content Reveal to report changes to the factual content of articles
Requires: 2.5 or higher
Compatible up to: 3.4.2
Last Updated: 2012-7-27
Downloads: 5,789
0 of 1 support threads in the last two months have been resolved.
Got something to say? Need help?