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

    Hello!
    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 https://kriesi.at/support/topic/toggle-accordion-not-working-with-wp5-6-enfold-4-7-5/ 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?

    #1339743

    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,
    Rikard

    #1339860

    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?

    #1339861

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

    #1339887

    Hi,
    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,
    Mike

    #1339899

    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.
    #1339967

    Hi,
    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
    2022-02-10_001.jpg
    other that that your toggles are working as expected, see our demo here.

    Best regards,
    Mike

    #1340031

    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.

    #1340068

    Hi,
    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,
    Mike

    #1340441

    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.

    #1340445

    Hi,

    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,
    Rikard

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