[Limited Time Offer] Get 40% off ALL ACCESS MEMBERSHIP before it’s gone!👉
mark Hendriksen logo

How to Make the Divi Accordion Closed

by Mark Hendriksen | Aug 17, 2019 | Divi tutorials | 35 comments

HomeDivi tutorialsHow to Make the Divi Accordion Closed

Mark Hendriksen

I am the founder here at MarkHendriksen.com a blog website for Web design, WordPress, and popular page builders.

By default, the first toggle on the Divi accordion is open and there is no option to make it closed. Fortunate there is a simple trick to make the first toggle also closed.

I will show you two methods of how you can make the accordion closed. The first method is a clever way to hide the first toggle with CSS (and just don’t use the first toggle and start your content on the second one). The second method we will close the toggle with some jQuery code.

You can also use the Divi Booster plugin to close the first tab.

Method 1: hide the first toggle with CSS

This is a very easy and simple method, first create an accordion with a couple of toggles. In my example, I have created 3 toggles.

Accordion example with 3 toggles

Now open the first toggle and go to the advanced tab. Under Custom CSS > Main Element fill in the following CSS:

display: none; 
Hide the first accordion toggle with CSS

And that’s it! You have now hidden the first tab and start with tab 2, and this one is closed by default.

Keep in mind that you can’t use the first toggle now, we have it hidden. So start with toggle 2.

Method 2: use jQuery to close the first accordion tab

Place the following jQuery in Divi > Theme Options > Integration > Add code to the < head > of your blog

<script>
jQuery(function($){
    $('.et_pb_accordion .et_pb_toggle_open').addClass('et_pb_toggle_close').removeClass('et_pb_toggle_open');

    $('.et_pb_accordion .et_pb_toggle').click(function() {
      $this = $(this);
      setTimeout(function(){
         $this.closest('.et_pb_accordion').removeClass('et_pb_accordion_toggling');
      },700);
    });
});
</script>

This jQuery code will close the accordion tab by default. With this method, you can still use the first toggle.

You might also like…

35 Comments

  1. Ken

    Thanks ! I appreciated the Help!

    Reply
  2. Scott Banks

    Hi Mark,
    Thanks for the lesson on the Divi accordian feature. I’d been experimenting with alternatives for same reason and got close – using a blank first accordian tab – but didn’t think to use your CSS technique. Problem solved now though. Appreciate your clarity and help!

    Reply
  3. Guillaume

    Thanks for the trick, so useful ! 😉

    Reply
  4. Kevan

    Thanks Mark. Great tip on the display: none for item 1. Didn’t think of that myself so here to say THANKS!

    Reply
  5. graphichero

    Excellent Tip and Trick. Thank You.

    Reply
  6. Judith

    Thank you so much, very helpful!

    Reply
  7. Sonjita

    Thanks a million, man!

    Reply
  8. Lloyd Dsouza

    Thank you.

    Reply
  9. sandra Van hulten

    thank you, works great!

    Reply
  10. Afonso Domingues

    Worked like a charm!
    Thank you.

    Reply
  11. Karen

    Thank you so much! Took 2 minutes (less?) and worked perfectly. Really appreciate it!

    Reply
    • Mark Hendriksen

      You’re welcome Karen

      Reply
  12. SuzElizabeth

    Absolutely perfect.
    Thank you so much!

    Reply
  13. Michiel Maandag

    Wow! That was easy! Thank you!

    Reply
  14. Paul

    Thanks for sharing.

    Reply
  15. jean

    THANK YOU ! Can’t understand why it isn’t in the settings

    Reply
  16. Chris

    Fantastic, we like simple

    Reply
  17. Crispo Mwangi

    Well done!!!!😍

    Reply
  18. Brett

    Many thanks! Exactly what I was looking for.

    Reply
  19. Nick

    Thanks so much! Now how to allow a single accordion to be closed once opened – any ideas!?

    Reply
    • Mark Hendriksen

      Hi Nick,

      Do you mean you want to use an accordion with one toggle?

      In that case, just use the toggle module instead of the accordion module.

      Reply
      • Nick

        That’s the one! Thanks so much, Mark, I didn’t know there was a toggle module!

        Reply
  20. Graham

    The CSS solution is so simple it’s great, which I had found your page before spending half an hour looking for the option and thinking about a solution.

    Reply
  21. Doug Wilson

    You. Beautiful. Bastard.

    Clean, clear, simple, and effective. This tip is a masterclass in how to … well, How To.

    Many, many thanks!

    Reply
    • Mark Hendriksen

      Thank you very much Doug 😀

      Reply
  22. Sanne

    Works! Thank you…

    Reply
    • Mark Hendriksen

      Good to hear Sanne

      Reply
  23. Bran

    still works, thank you very much

    Reply
  24. Hanneke

    Thanks a lot!!

    Reply
  25. Julie

    This simple workaround worked great for me. Thanks for posting.

    Reply
    • Mark Hendriksen

      Your welcome Julie

      Reply
  26. Litbea

    Thanks a lot, I was trying other two methods that didn’t work but your did!.

    Reply
    • Mark Hendriksen

      Hi Litbea,

      Good to hear it worked out

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *