Title: Nested Content Toggle
Last modified: December 28, 2022

---

# Nested Content Toggle

 *  Resolved [greentreefrog](https://wordpress.org/support/users/greentreefrog/)
 * (@greentreefrog)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/nested-content-toggle/)
 * I am using Content Toggle for FAQ’s and that part works fine. However, I wanted
   to put “References” at the bottom of the first panel and not display the actual
   references until someone clicks on “References.” Theoretically, if I inserted
   a Content Toggle box inside the first FAQ, I could get exactly what I want.
 * I have all panels closed by default when the page first loads and that’s working
   fine. The problem is that the “References” Content Toggle is ALWAYS open as soon
   as its parent’s FAQ is open after the page first loads. If I click on it to close
   it, it works fine. If I click the parent closed after I click “References” to
   close and then reopen the parent, “References” is still closed, which is perfect.
 * I have the settings on the child set to “Collapsed” and “Collapse on Mobile.”
   For the parent, “Collapsed” is also set but “Collapse on Mobile” is not.
 * When I inspect the HTML, the div attributes for the child for data-mobilecollapse
   and data-desktopcollapse are both set to “true”, yet the panel is showing. The
   div tag around the panel does not have the “ub-hide” class until I close it manually.
   In fact, it doesn’t have “ub-hide” on it when the page first loads either, even
   though the parent panel DOES have the “ub-hide” class initially. I think if “
   ub-hide” were added to the child when the page loaded, everything would work 
   perfectly.
 * I could fix this with my own JavaScript but if you’d like to fix it, I would 
   be most grateful!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fnested-content-toggle%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [greentreefrog](https://wordpress.org/support/users/greentreefrog/)
 * (@greentreefrog)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/nested-content-toggle/#post-16324247)
 * I just added my own JQuery so you won’t be able to see the problem on my page
   anymore. I added my own class to the inner content toggle block. Here is the 
   resulting JQuery code, which runs once after the page is loaded:
 *     ```wp-block-code
        function mjbHideNestedToggle() {
               $('.mjb-ub-inner-toggle .wp-block-ub-content-toggle-accordion .wp-block-ub-content-toggle-accordion-content-wrap').each(function(){
                   $(this).addClass('ub-hide');
               })
           }
       ```
   
 * Everything is perfect now!
 * Please let me know if you update the plugin to handle this so that I can remove
   my code.
 * Thanks!
 *  Plugin Contributor [Alexis Pandaan](https://wordpress.org/support/users/alexius08/)
 * (@alexius08)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/nested-content-toggle/#post-16339378)
 * Hi [@greentreefrog](https://wordpress.org/support/users/greentreefrog/) ! A recent
   update to the way WordPress handles blocks that contains inner blocks introduced
   bugs to the rendering of our content toggle block. We’ll be including a fix for
   this to the upcoming version of the plugin, which would hopefully render your
   custom fix redundant. We’ll let you know when it becomes available.
 *  Plugin Contributor [Alexis Pandaan](https://wordpress.org/support/users/alexius08/)
 * (@alexius08)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/nested-content-toggle/#post-16436308)
 * Hi [@greentreefrog](https://wordpress.org/support/users/greentreefrog/) ! We’ve
   released a new version of the plugin that includes a fix for your issue with 
   the content toggle block. All new instances of the block should no longer have
   that problem. For your current content, you can make new content toggle blocks
   and copy the contents of the old ones there, which should work without your workaround.
 * Please let us know how it goes.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Nested Content Toggle’ is closed to new replies.

 * ![](https://ps.w.org/ultimate-blocks/assets/icon-256x256.png?rev=2966061)
 * [Ultimate Blocks – 25+ Gutenberg Blocks for Block Editor](https://wordpress.org/plugins/ultimate-blocks/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-blocks/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-blocks/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-blocks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-blocks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-blocks/reviews/)

## Tags

 * [content toggle](https://wordpress.org/support/topic-tag/content-toggle/)
 * [nesting](https://wordpress.org/support/topic-tag/nesting/)

 * 3 replies
 * 2 participants
 * Last reply from: [Alexis Pandaan](https://wordpress.org/support/users/alexius08/)
 * Last activity: [3 years, 2 months ago](https://wordpress.org/support/topic/nested-content-toggle/#post-16436308)
 * Status: resolved