Confused on adding javascript to Child Theme and calling it on specific page.
-
So I am having serious issues trying to understand how to add javascript and call it to a theme.
I read through these support guides:
jQuery noConflict Wrappers
wp_enqueue_script
Child ThemesI even found a tutorial that helped me and have asked around the internet searching high and low for an answer. Which all seem very vague and hard to understand.
What I am trying to do is add responsive tooltip to one page of my site, the tutorial for it is here:
I understand that I need to create a function.php file for the child theme I am using. I also changed the first line of the java so there is no conflict error.
I have absolutely no idea what I need to put in the function.php file and how to exactly call on the java for the one specific page of my site.
This is what I have:
<?php if (function_exists('tool_tips')) { function tool_tips() { if (!is_admin()) { wp_deregister_script( 'jquery' ); wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js'); wp_enqueue_script('jquery'); wp_register_script('tooltips', bloginfo('template_url').'/working/wp-content/themes/responsive-child/tooltip.js'__FILE__), array('jquery'), '1.0', true ); wp_enqueue_script('tooltips'); } } } add_action('init', 'tool_tips'); ?>
I have asked around and have been searching for a week and feel no closer to the answer then when I started.
I am very new with wordpress and java so it is a bit frustrating. I would love it if someone could help clear it up for me?
My site is here
- The topic ‘Confused on adding javascript to Child Theme and calling it on specific page.’ is closed to new replies.