Content Reveal allows you to easily hide and reveal WordPress content, whether it's in the sidebar or in a post or page.
The short code is
[reveal] and it can be used in one of two ways - either using the shortcode twice or by closing it, as usual. For example...
[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]
The following parameters are valid...
%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.
showto indicate (default is
hide, although you can change this in the options screen).
img_urlcan still be used.
Important: Make sure you add this using the html/code editor in WordPress, not the visual editor. 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.
It is possible to add one content reveal section within another. Here is an example of how to do this - note the use of the end tags to achieve this.
[reveal heading="<h2>%image% Some Blah Content Below</h2>" id="id1"]Blah, blah, blah content here[reveal heading="<h3>%image% Some More Blah Content Below</h2>" id="id2"]Blah, blah, blah more content here[reveal][/reveal]
folder may be used to specify a different folder in which you can add your icons. The icons must be named image1 and image2 and can be either .gif or .png images.
You can either specify a full URL or a folder name. In the latter case, it will be assumed the folder is within
wp-content/uploads/content-reveal/. The advantage of the latter is that images in this folder will be omitted from Jetpack's Photon function - please see the next section for details on this.
The default icons are automatically omitted from Photon and also any icons added to
wp-content/uploads/content-reveal/. If you provide icons from any other folder and use Photon then you may find they don't display correctly.
If you wish to show the title separately from the hidden/reveal text then an alternative shortcode is available, 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 -
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.
In the Administration menu you should find an 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=0would cause all the current user's cookies for this plugin to be deleted
[acr_cookies]exists. An example of output may be
The cookie is named
x is the ID of the given content section.
As previously mentioned in the Administration menu there is an option under "Settings" named "Content Reveal". Apart from the cookie settings, you can also set the default state for showing or hiding content. You can also decide whether to switch on or off the editor button - this is an additonal button that appears in the visual editor and, when pressed, creates a default example of the shortcode.
Requires: 3.3 or higher
Compatible up to: 4.5.4
Last Updated: 5 months ago
Active Installs: 1,000+
Got something to say? Need help?