Link to home
Create AccountLog in
Avatar of cyborama
cyboramaFlag for United States of America

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_uri());
      require_once (OF_FILEPATH . '/lib/custom/widgets.php');       // include widgets
      
            
?>

<?php
if(!is_admin()){
      wp_deregister_script('jquery');
      wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"), false, '');
}?>

<?php
wp_enqueue_script('maphighlight', '/wp-content/themes/laboratory_child/js/maphilight.js', array('jquery'), false, false);
wp_enqueue_script('maphighlight', '/wp-content/themes/laboratory_child/js/maphighlightcall.js', array('jquery'), false, false);
wp_enqueue_script('maphighlight', '/wp-content/themes/laboratory_child/js/maphilightcall.js', array('jquery','maphighlight'),'1.0.0', false, false);
 

 ?>

<?php

wp_enqueue_script('qtip', '/wp-content/themes/laboratory_child/js/qtip-min.js', array('jquery'), false, true);
wp_enqueue_script('qtipCall', '/wp-content/themes/laboratory_child/js/qtipcall.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
Avatar of cyborama
cyborama
Flag of United States of America image

ASKER

Hello Again:

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_uri());
      require_once (OF_FILEPATH . '/lib/custom/widgets.php');       // include widgets
      
            
?>

<?php
if(!is_admin()){
      wp_deregister_script('jquery');
      wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"), false, '');
}?>

<?php
wp_enqueue_script('maphighlight', '/wp-content/themes/laboratory_child/js/maphilight.js', array('jquery'), false, false);
wp_enqueue_script('maphighlight', '/wp-content/themes/laboratory_child/js/maphilightcall.js', array('jquery','maphighlight'),'1.0.0', false, false);
 

 ?>

<?php

wp_enqueue_script('qtip', '/wp-content/themes/laboratory_child/js/qtip-min.js', array('jquery'), false, true);
wp_enqueue_script('qtipCall', '/wp-content/themes/laboratory_child/js/qtipcall.js' , array('jquery', 'qtip'), false, true); ?>


---------------------------------------------------------------------------------------
ASKER CERTIFIED SOLUTION
Avatar of cyborama
cyborama
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer