Adding Custom Javascript to Child Theme (how to format the code)
-
Hello,
I have added a custom menu to the sidebar on one of my pages, but due to the amount of pages, it is too long. http://kinglocksmiths.com/washington-dc-locksmith/
I found this code to help me make the menu collapsible
http://mysitemyway.com/docs/index.php/Collapsible_sidebar_menus
jQuery(document).ready(function(){ jQuery('.menu .dropdown a').click(function(e){ e.preventDefault(); if (jQuery(this).parent().children('.sub-menu:first').is(':visible')) { jQuery(this).parent().children('.sub-menu:first').hide(); } else { jQuery(this).parent().children('.sub-menu:first').show(); } }); });
But when I put this in the function.php file of the child theme, I get an error. I am not familiar with javascript, and don’t know if I need to change this code or format it differently.
Can you help me?
Thank you,
Sarah
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Adding Custom Javascript to Child Theme (how to format the code)’ is closed to new replies.