Title: Toggle Not Working Outside Loop
Last modified: November 20, 2018

---

# Toggle Not Working Outside Loop

 *  [fortyfivecreative](https://wordpress.org/support/users/fortyfivecreative/)
 * (@fortyfivecreative)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/toggle-not-working-outside-loop/)
 * Hi, it seems that if I add the shortcode to a page template outside the loop,
   the questions display but I cannot toggle the answers open. Any help would be
   much appreciated. Thanks…

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

 *  Thread Starter [fortyfivecreative](https://wordpress.org/support/users/fortyfivecreative/)
 * (@fortyfivecreative)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/toggle-not-working-outside-loop/#post-10931497)
 * Quick follow up to this. It seems that jquery.genesis-simple-faq.min.js is not
   being called unless [gs_faq] is placed in the main editor window. I could call
   the JS manually but this seems to be a bit messy. Can anyone please help with
   a fix? Thanks
 *  Plugin Contributor [Nick C](https://wordpress.org/support/users/modernnerd/)
 * (@modernnerd)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/toggle-not-working-outside-loop/#post-10934777)
 * Hi, [@fortyfivecreative](https://wordpress.org/support/users/fortyfivecreative/).
 * For now you would need to edit the plugin to load the dependencies even if shortcodes
   appear outside the main content.
 * That’s currently controlled in the [‘load_dependencies’ method here](https://github.com/studiopress/genesis-simple-faq/blob/21b2505dbfc264ea0fc7c5d63f7504da8bdf1bf4/includes/class-gs-faq-shortcode.php#L103-L117).
 * You could change this:
 *     ```
       // Load assets if in post content.
       if ( has_shortcode( $content, 'gs_faq' ) ) {
       	Genesis_Simple_FAQ()->assets->enqueue_scripts();
       }
       ```
   
 * To this:
 *     ```
       Genesis_Simple_FAQ()->assets->enqueue_scripts();
       ```
   
 * There’s an issue to look into this in a future plugin update, but I don’t have
   a timeline for an official fix just yet. [https://github.com/studiopress/genesis-simple-faq/issues/34](https://github.com/studiopress/genesis-simple-faq/issues/34)

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

The topic ‘Toggle Not Working Outside Loop’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/genesis-simple-faq_7da5c5.svg)
 * [Genesis Simple FAQ](https://wordpress.org/plugins/genesis-simple-faq/)
 * [Support Threads](https://wordpress.org/support/plugin/genesis-simple-faq/)
 * [Active Topics](https://wordpress.org/support/plugin/genesis-simple-faq/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/genesis-simple-faq/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/genesis-simple-faq/reviews/)

## Tags

 * [js](https://wordpress.org/support/topic-tag/js/)
 * [loop](https://wordpress.org/support/topic-tag/loop/)
 * [not working](https://wordpress.org/support/topic-tag/not-working/)
 * [problem](https://wordpress.org/support/topic-tag/problem/)
 * [toggle](https://wordpress.org/support/topic-tag/toggle/)

 * 2 replies
 * 2 participants
 * Last reply from: [Nick C](https://wordpress.org/support/users/modernnerd/)
 * Last activity: [7 years, 6 months ago](https://wordpress.org/support/topic/toggle-not-working-outside-loop/#post-10934777)
 * Status: not resolved