Author Topic: Wordpress Javascript wp_head array  (Read 5814 times)

0 Members and 1 Guest are viewing this topic.

Offline Basilakis

  • Jr. Member
  • **
  • Posts: 39
    • View Profile
Wordpress Javascript wp_head array
« on: 25 September 2009, 07:42 »

I am trying to figure out how to put a JS array and print it @ wp_head

I am doing this

Code: [Select]
function weather_process_header() {
echo "\n".'<!-- Start Of Script Generated By weather-plugin -->'."\n";
wp_register_style('weather-plugin-css', plugins_url('weather-plugin/weather.css'), false, '0.1', 'all');
wp_enqueue_script('ajaxcontent', '/wp-content/plugins/weather-plugin/js/ajax-dynamic-content.js', array('weatherplugin'), '2.1');
wp_enqueue_script('ajaxweather', '/wp-content/plugins/events-calendar/js/ajax-weather.js', array('weatherplugin'), '1.0b2');
wp_print_scripts(array('weather-plugin', 'weatherplugin'));
wp_print_styles(array('weather-plugin', 'weather-plugin-css'));
echo '<!-- End Of Script Generated By weather-plugin -->'."\n";

and then to the wp_head

Code: [Select]
add_action('wp_head', 'weather_process_header');

But it does not seem to work fine... It prints the CSS but not the JS array. Any help? :D
« Last Edit: 25 September 2009, 09:00 by Basilakis »

Offline GaMerZ

  • Administrator
  • *****
  • Posts: 11,692
    • View Profile
  • WordPress Version: WordPress 3.0.x
  • Theme Name: v3.4

++ - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.