cyborama
asked on
wp_enqueue_script issues
Hello There:
I am trying to get my qtip jquery plugin and maphighlight.js plugin to work without conflicts. I was instantiating these things in the header.php file but after further reading discovered this was not the place to put them. In fact under the qtip documentation it was suggested for word press I place the qtip in the footer. I opted to put the maphighlight in the header though via the false parameter.
Anyway I successfully instantiated the qtip.js file and the qtipcall.js file (this was the one I stored my function call into in order to instantiate the plugin) I also successfully got the maphighlight.js file to load up in the header.php file via placing all this code in the functions.php file.
Anyway for what ever reason my file called maphighlightcall.js (which has the details for call the script with details) would not load either in the header or footer.php file via this wp_enqueue_script function.
Next I tried just using bizarre names like jinks,js and house.js but thiese files would not load either. It seems like qtipcall.js loaded flawlessly along with qtip.js but not much else.
here is the code in my functions.php file below
-------------------------- ---------- ---------- ---------- ---------- ---
<?php
define('OF_FILEPATH', TEMPLATEPATH);
define('OF_DIRECTORY', get_stylesheet_directory_u ri());
require_once (OF_FILEPATH . '/lib/custom/widgets.php') ; // include widgets
?>
<?php
if(!is_admin()){
wp_deregister_script('jque ry');
wp_register_script('jquery ', ("http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"), false, '');
}?>
<?php
wp_enqueue_script('maphigh light', '/wp-content/themes/labora tory_child /js/maphil ight.js', array('jquery'), false, false);
wp_enqueue_script('maphigh light', '/wp-content/themes/labora tory_child /js/maphig hlightcall .js', array('jquery'), false, false);
wp_enqueue_script('maphigh light', '/wp-content/themes/labora tory_child /js/maphil ightcall.j s', array('jquery','maphighlig ht'),'1.0. 0', false, false);
?>
<?php
wp_enqueue_script('qtip', '/wp-content/themes/labora tory_child /js/qtip-m in.js', array('jquery'), false, true);
wp_enqueue_script('qtipCal l', '/wp-content/themes/labora tory_child /js/qtipca ll.js' , array('jquery', 'qtip'), false, true); ?>
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- -
Just so you know I tried these functions without the editional qtip after Jquery or the additional maphilight after jquery as well but same problem. In both cases I kept the Jquery. It probably is something simple but I have been looking at this forever and am so stuck.
Any help would be appreciated
Bo
I am trying to get my qtip jquery plugin and maphighlight.js plugin to work without conflicts. I was instantiating these things in the header.php file but after further reading discovered this was not the place to put them. In fact under the qtip documentation it was suggested for word press I place the qtip in the footer. I opted to put the maphighlight in the header though via the false parameter.
Anyway I successfully instantiated the qtip.js file and the qtipcall.js file (this was the one I stored my function call into in order to instantiate the plugin) I also successfully got the maphighlight.js file to load up in the header.php file via placing all this code in the functions.php file.
Anyway for what ever reason my file called maphighlightcall.js (which has the details for call the script with details) would not load either in the header or footer.php file via this wp_enqueue_script function.
Next I tried just using bizarre names like jinks,js and house.js but thiese files would not load either. It seems like qtipcall.js loaded flawlessly along with qtip.js but not much else.
here is the code in my functions.php file below
--------------------------
<?php
define('OF_FILEPATH', TEMPLATEPATH);
define('OF_DIRECTORY', get_stylesheet_directory_u
require_once (OF_FILEPATH . '/lib/custom/widgets.php')
?>
<?php
if(!is_admin()){
wp_deregister_script('jque
wp_register_script('jquery
}?>
<?php
wp_enqueue_script('maphigh
wp_enqueue_script('maphigh
wp_enqueue_script('maphigh
?>
<?php
wp_enqueue_script('qtip', '/wp-content/themes/labora
wp_enqueue_script('qtipCal
--------------------------
Just so you know I tried these functions without the editional qtip after Jquery or the additional maphilight after jquery as well but same problem. In both cases I kept the Jquery. It probably is something simple but I have been looking at this forever and am so stuck.
Any help would be appreciated
Bo
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
After submitting the code I realized I had a duplicate maphighlightcall.js file so I eliminated that and reuploaded the functions.php file but still same problem here was my latest code with the elimination of that duplicate call out
--------------------------
<?php
define('OF_FILEPATH', TEMPLATEPATH);
define('OF_DIRECTORY', get_stylesheet_directory_u
require_once (OF_FILEPATH . '/lib/custom/widgets.php')
?>
<?php
if(!is_admin()){
wp_deregister_script('jque
wp_register_script('jquery
}?>
<?php
wp_enqueue_script('maphigh
wp_enqueue_script('maphigh
?>
<?php
wp_enqueue_script('qtip', '/wp-content/themes/labora
wp_enqueue_script('qtipCal
--------------------------