-
AuthorPosts
-
February 9, 2022 at 6:28 am #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?February 9, 2022 at 9:48 am #1339743Hey 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,
RikardFebruary 9, 2022 at 7:22 pm #1339860Yes, 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?February 9, 2022 at 7:23 pm #1339861I did deactivate all plugins which didn’t make any difference.
February 10, 2022 at 4:03 am #1339887Hi,
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,
MikeFebruary 10, 2022 at 6:16 am #1339899I 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, 9 months ago by ellamac.
February 10, 2022 at 1:35 pm #1339967Hi,
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,
MikeFebruary 10, 2022 at 7:49 pm #1340031Yes, 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.
February 11, 2022 at 1:33 am #1340068Hi,
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,
MikeFebruary 14, 2022 at 6:00 am #1340441Hi 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.February 14, 2022 at 7:04 am #1340445Hi,
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 -
AuthorPosts
- The topic ‘Accordion Toggle Not Working’ is closed to new replies.