Parrothead @ WP ShowHide Elements


I’ve been including this plugin in my themes for a while and came up with a shortcode to make it easier for my clients.

Open source contribution.

Add this to functions.php:

function Showhide($atts, $content = null){
extract( shortcode_atts( array(
‘title’ => ‘Add Title’,
), $atts ) );
$nice_title = str_replace(‘ ‘,”,$title);
$rand = rand(0,20);
$accordion = ‘‘.$title.’‘;
$accordion .= ”. do_shortcode($content) .”;
return $accordion;


Here’s usage for the shortcode:
[Showhide title=’A really good Question?’]
With a really good answer.