Collapsible Widget Area
Accordions closed by default (3 posts)

  1. Mike
    Posted 4 years ago #

    Any way to make the accordions start off closed by default?



  2. Curtiss Grymala
    Plugin Author

    Posted 4 years ago #

    There is no option to accomplish this easily, but you might be able to do so with a little extra JavaScript.

    You might be able to do so with some code like the following in your theme's functions.php file.

    add_action( 'wp_print_footer_scripts', 'start_collapsible_closed', 2 );
    function start_collapsible_closed() {
    <script type="text/javascript">
    jQuery( function( $ ) {
        $( '.collapsible-widget-container' ).accordion( "option", "collapsible", true );
        $( '.collapsible-widget-container' ).accordion( "option", "active", false );
    } );

    I haven't tested that, but it appears it should work. A warning about this, though: if you change the settings for the plugin so that it uses a tabbed interface instead of the accordion interface, this code will probably start throwing JavaScript errors.

    I'll look into adding this as an option in the plugin itself. Thanks for the suggestion.

  3. bthabault13
    Posted 4 years ago #


    Great plugin!

    I added this code and didn't see any effect, is there anyway you could test it out and see if there is an error?


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Collapsible Widget Area
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic