Title: open all button
Last modified: March 9, 2017

---

# open all button

 *  Resolved [judyvedder](https://wordpress.org/support/users/judyvedder/)
 * (@judyvedder)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/open-all-button/)
 * I have the js file exactly as you show in the FAQ section and I have verified
   that the file is being loaded in view source. I went through your support thread
   and saw that I need autoclose=”false” in the accordion area. [accordion autoclose
   =”false” clicktoclose=”true” tag=h6] . I have tried [accordion-item] with and
   without a state set. Can you provide an example with the settings that work? 
   Also where does the button code with class=js-open-everything go? Before the [
   accordion] or after. I cannot get this to work!

Viewing 1 replies (of 1 total)

 *  Plugin Author [philbuchanan](https://wordpress.org/support/users/philbuchanan/)
 * (@philbuchanan)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/open-all-button/#post-8896368)
 * The button to open and close the accordions can go anywhere on the page, as long
   as the JavaScript file is loaded _after_ it.
 * Your opening accordion tag looks right as well.
 * Here is an example you can paste into the Text (HTML) tab of your page editor:
 *     ```
       <button class="js-open-everything">Open Everything</button>
   
       [accordion autoclose="false" clicktoclose="true" tag=h6]
   
       [accordion-item title="Accordion Item One"]
   
       Content here.
   
       [/accordion-item][accordion-item title="Accordion Item Two"]
   
       More content here.
   
       [/accordion-item][accordion-item title="Accordion Item Three"]
   
       Third block of content goes here.
   
       [/accordion-item]
   
       [/accordion]
       ```
   
 * There may also be an issue with the JavaScript, depending on where you place 
   it in your file. Maybe try this:
 *     ```
       jQuery(document).ready(function($) {
       	$('.js-open-everything').click(function() {
       	    $.each($('.accordion-title'), function(index, value) {
       	        if (!$(this).hasClass('open')) {
       	            $(this).click();
       	        }
       	    });
       	});
       });
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘open all button’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/accordion-shortcodes.svg)
 * [Accordion Shortcodes](https://wordpress.org/plugins/accordion-shortcodes/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/accordion-shortcodes/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/accordion-shortcodes/)
 * [Active Topics](https://wordpress.org/support/plugin/accordion-shortcodes/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/accordion-shortcodes/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/accordion-shortcodes/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [philbuchanan](https://wordpress.org/support/users/philbuchanan/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/open-all-button/#post-8896368)
 * Status: resolved