title: Twitter Bootstrap Collapse Accordion - Wordpress Shortcode
body: <p>I have shortcode for implementation of Twitter Bootstrap Collapse in a Wordpress theme.</p>
  
  <p>It works fine but I would like to include the option to have one of the accordion groups open by specifying it in the shortcode? Currently all the groups are closed by default and you have to click on the title for it to open. </p>
  
  <p>I'm presuming I can use <code>class="item active"</code> or something similar I'm just a bit stuck.</p>
  
  <p>This is the function I have in functions.php of my theme:</p>
  
  <pre><code>function collapse($atts, $content = null) {  
       extract(shortcode_atts(array(  
       'accordion' =&gt; '',
       'title' =&gt; ''  
       ), $atts));  
  
  return '&lt;div class="accordion-group"&gt;
      &lt;div class="accordion-heading"&gt;
      &lt;a class="accordion-toggle" data-toggle="collapse" 
      data-parent="accordion2" href="#collapse'.$accordion.'"&gt;&lt;h2&gt;'.$title.'&lt;/h2&gt;&lt;/a&gt;
      &lt;/div&gt;
       &lt;div id="collapse'.$accordion.'" class="accordion-body collapse"&gt;
          &lt;div class="accordion-inner"&gt;'.$content.'&lt;/div&gt;
       &lt;/div&gt;
      &lt;/div&gt;';  } 
  </code></pre>
  
  <p>and the short code for the page looks like this:</p>
  
  <p>[collapsegroup]</p>
  
  <p>[collapse accordion="One" title="Something"]</p>
  
  <p>[/collapse]</p>
  
  <p>[collapse accordion="Two" title="Something"]</p>
  
  <p>[/collapse]</p>
  
  <p>[/collapsegroup]</p>