Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
  • #1339705

    I’ve recently updated to WP5.9 and Enfold 4.8.9 and the accordion element is no longer working and just shows URL #toggle-id-2-closed
    I worked through some of the suggestions on the thread including :
    – Enable jQuery Migrate Helper
    – Disable all plugins
    – Disable JavaScript merging
    but still am unable to fix the error. Are you able to take a look, please?


    Hey Suze,

    Thanks for the login details. Does it make any difference if you temporarily activate the parent theme? If it starts working after that, then the problem is likely coming from one of the files which you are overriding in your child theme. You could also try to deactivate all plugins, to see if that makes any difference.

    Best regards,


    Yes, it works when the parent theme is active.
    I’ve updated header.php and shortcodes.js in the child theme which hasn’t fixed the problem.
    And when I replaced the functions.php file with the latest version I received a critical error.
    Is there something I need to manually change in the functions.php file?


    I did deactivate all plugins which didn’t make any difference.


    Thanks for the login, disabling your child theme /js/shortcodes.js by disabling this function in your functions.php solves the issue:

    function wp_change_shortcodesjs() {
       wp_dequeue_script( 'avia-shortcodes' );
       wp_enqueue_script( 'avia-shortcodes-child', get_stylesheet_directory_uri().'/js/shortcodes.js', array('jquery'), 2, true );
    add_action( 'wp_print_scripts', 'wp_change_shortcodesjs', 100 );

    so there is an error in your shortcodes.js, please review, if you can not find the error then replace with a new copy of the current parent theme shortcodes.js

    Best regards,


    I removed the following code (Mike’s post) from functions.php and then replaced the shortcodes.js file with the latest from the Enfold download which has helped – I can open one toggle only but then any following toggles automatically scroll to the top of the page every time.

    function wp_change_shortcodesjs() {
    wp_dequeue_script( ‘avia-shortcodes’ );
    wp_enqueue_script( ‘avia-shortcodes-child’, get_stylesheet_directory_uri().’/js/shortcodes.js’, array(‘jquery’), 2, true );
    add_action( ‘wp_print_scripts’, ‘wp_change_shortcodesjs’, 100 );

    Any further suggestions?
    PS– there is second Accordion element on the home page that shows exactly the same behaviour.

    • This reply was modified 2 years, 4 months ago by ellamac.

    I reason only one opens at a time is because you have it set to Only one toggle open at a time (Accordion Mode) if you want then use the Multiple toggles open allowed (Toggle Mode) option
    other that that your toggles are working as expected, see our demo here.

    Best regards,


    Yes, I understand the different settings but the demo doesn’t scroll to the top of the page. What I was trying to say is that the first toggle selected opens as it should and then every subsequent toggle scrolls to the top of the page.


    This is not occurring when I test your page, please explain what device and browser you are using.
    Does this have anything to do with why your shortcodes.js was customized in the first place? I see that you have quite a few files in your child theme are all of these customized?

    Best regards,


    Hi Mike,
    It is now working well with all toggles opening and NO scrolling : )
    I did Purge All Cache but think it might have been a Google Chrome browser error.
    Many thanks for your help!! This can now be closed.



    Great, I’m glad that you got everything working, and thanks for the update. I’ll close this thread for now then, please open a new thread if you should have any further questions or problems.

    Best regards,

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Accordion Toggle Not Working’ is closed to new replies.