/* ------------------- toggle function ------------------- */ /* Developed by Mosaik Web http://mosaikweb.com */ /* Add this code to your theme's function file */ /*---------------------------------------------------------------*/ if( !function_exists('mw_toggle_content') ) { function mw_toggle_content( $atts, $content = null ) { /** * Default settings * Plugin will use this setting if user not made custom setting via settings page or tag. */ $title='Toggle Title'; $shortname=''; /* Read User Input for Short code */ extract(shortcode_atts(array( 'title' => '', shortname => ' ', ), $atts)); /* Initialize function variables $parameter=''; $class=''; $toggle='no'; $output = ''; /* Determine if a value was included as part of the URL link to the page */ $parameter = $_SERVER['QUERY_STRING']; /* If a match is made between the value passed with the link and a "shortname", then add class "start" to the toggle header so we know to open that toggle section */ if ($parameter == $shortname ) { $class='start'; $toggle='';} $output .= '

' .$title .'

'; $output .= '
'; $output .= '
'; $output .= do_shortcode($content); $output .= '
'; $output .= '
'; return $output; } add_shortcode('toggle', 'mw_toggle_content'); /* End of Toggle function code */ } } }