• Resolved shapal

    (@shapal)


    I put the shortcodes in an ACF wysiwyg field and, while the buttons for the FAQs show up on the front end, they don’t expand when you click. If I put the same shortcodes in a ordinary page (native to WP), the FAQs work as expected. I’m currently doing this online, so I can’t give a you a link to the exapmle.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Nick C

    (@modernnerd)

    Hi, @shapal.

    It looks like we’ve responded to you by email in StudioPress support. I hope it helped!

    For others who see the same problem, Genesis Simple FAQ only enqueues its JavaScript if it detects an FAQ widget on the page or the gs_faq shortcode in the main site content.

    If you’re using the shortcode elsewhere, such as in custom fields, you can enqueue the FAQ scripts on other pages by adding this code to your theme’s functions.php:

    add_action( 'wp_enqueue_scripts', 'load_simple_faq_scripts' );
    /**
     * Enqueue Genesis Simple FAQ scripts on all pages, even if no gs_faq shortcode is found in main content.
     *
     * @return void
     */
    function load_simple_faq_scripts() {
    	if ( class_exists( 'Genesis_Simple_FAQ' ) ) {
    		Genesis_Simple_FAQ()->assets->enqueue_scripts();
    	}
    }
    jodzeee

    (@jodzeee)

    I’m having the same problem when adding the shortcode in Beaver Builder. Adding that code to functions.php did not work.

    The theme I’m using is Mai Lifestyle Pro. I tried it with the Sample Theme and it didn’t even show as buttons, the Q/A are expanded w/no styling. Works fine though if the shortcode is placed in the normal editor without Beaver Builder.

    I know I can use an accordion in Beaver to build this, but I had built and styled it already before deciding to use BB, so was hoping for a quick fix. If not, I guess I’ll have to recreate it.

    • This reply was modified 7 years ago by jodzeee. Reason: More detail after trying another theme
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘JS not working in ACF’ is closed to new replies.