Some time back we shared a small snipped that would create a show or hide a content blind in WordPress. Unfortunately, it sucked. I still remember writing the code as a quick solution to a client request bouncing around in the back of car during a layover in Los Angeles... and this was in the days when all I had was my trusty Nokia E72. The code on this page isn't necessarily much better but it does negate the need for scoped CSS, and with the exception of a scrolling delay that 'animates' the content blind it's not entirely different to the original. I'm sharing this code here rather than our Codex only because it was necessary for an article published a few days ago, and it replaces the shonky previous version.
A feature not totally unlike what is shown below is included in our client plugin as a calendar display option; in many cases a client won't want to render a standalone calendar on a page (which is a one-click feature provided by default) in Yabber , but showing a calendar by way of 'Make a Booking' text may be useful.
The result is rather pedestrian, but still very nice on the page.
Yep, you've clicked me and now you're seeing hidden text. You may alter the link text and the speed at which the blind renders. Simple. As we said, it's handy for elements such as a calendar (integrated into Yabber by default) but it's also useful for notes, comments, and less relevant content blocks.
While editing CSS inline upsets many, there's an option for cases when you want to include styling to the returned DIV; in this case we've also provided an unrealistic toggle delay of 2 seconds. For example.
To return a basic blind, and not unlike our previous shortcode, simply use as follows:
[blind title="Title in here"]Your Content in here...[/blind].
Copy and paste the WordPress function into your theme's
functions.php file or, if you sensibly have one installed, your custom functions plugin.
The following shortcode attributes are available.
style="border-left: 1px solid #000000; padding-left: 30px;".
The code isn't ideal, but it's short and easy to use. If you're a client and logged into our client portal you'll have access to a standalone Elementor block. However, the feature is now included in our BeliefMedia plugin by default.