i'm not able to enqueue the built in autosuggest script in my wordpress theme.
wp_enqueue_script('suggest');
my current workaround for that problem is to deregister, register manually an then enqueue it – like so:
wp_deregister_script('suggest');
wp_register_script('suggest', '/wp-includes/js/jquery/suggest.js');
wp_enqueue_script('suggest');
i can't figure out how to solve this problem, because i get no error at all (WP_DEBUG defined TRUE)
thanks for your thoughts, hans
//update
sorry for being a bit cloudy with the description of my problem:
i am working on a wiki-like thing based on wordpress. there is one page where users can upload new images and tag them (this is where i need the suggest.js).
the templatefile for this page looks like:
<?php
//enqueue scripts + styles
wp_enqueue_script('uploadify', get_bloginfo('template_directory') . '/js/uploadify/jquery.uploadify.v2.1.0.js', array('jquery'), null, null);
wp_enqueue_script('swfobject', get_bloginfo('template_directory') . '/js/uploadify/swfobject.js', array('jquery'), null, null);
wp_enqueue_script('jcrop');
wp_enqueue_style('jcrop');
wp_deregister_script('suggest'); //workaround
wp_register_script('suggest', '/wp-includes/js/jquery/suggest.js'); //workaround
wp_enqueue_script('suggest'); //workaround
...
get_header();
page content that uses scripts & styles
get_footer();
?>
at the very beginning of the file i'm enqueueing the additional styles/scripts i need for that single page. (other "basic" scripts + styles get enqueued in my functions.php)
enqueueing jcrop for example works without any problems…
wp_print_script( 'suggest' )? – m0r7if3r Mar 8 '12 at 14:07wp_enqueue_scriptbywp_print_script. doesn't seem to change anything… – hans Mar 8 '12 at 16:58