I have the exact same files (except for wp-config) running on a local server and a test server, and in my functions.php I have this:

    function len_scripts() {
        if (!is_admin()):
add_action('wp_print_scripts', 'len_scripts');

On my localhost, everything works fine and all files are happily working. But on the test server, somehow, thickbox never gets called, i don't get any errors on the console and Firebug Network tab simply doesn't know it was supposed to be calling that file.

thickbox.css gets called, jquery.js also. thickbox.js doesn't.

Any ideas why this might be?


  • len_scripts() is called on wp_print_scripts, so no big deal here - there are other enqueue functions that i left out, and they are all working as expected.

  • Firebug console does not throw any errors, in fact, it doesn't recognize thickbox.js at all, like if the function calling it was never there. It doesnt appear in the console, the DOM, or the Network tab. No mention, not even 404 (but the file is indeed there).

  • In my final markup i get the script tag for jquery, then the script tag for other .js files, but never for thickbox. I do get a link tag for thickbox.css though, along with my other .css tags.

  • 2
    Read: codex.wordpress.org/Function_Reference/wp_enqueue_script, quoting important part: "This function will not work if it is called from a wp_head or wp_print_scripts actions, as the files need to be enqueued before those actions are run." – soulseekah Mar 9 '12 at 21:48
  • nevermind. Just found out that the theme was never calling wp_footer(); (wasn't me, i swear.) Thickboxs always goes on the footer. – moraleida Mar 9 '12 at 21:55
  • @moraleida Move this to an answer and mark your question as answered. – fuxia Mar 9 '12 at 22:15

You don’t need to enqueue jQuery if you enqueue ThickBox already. See this answer for details.

thickbox.css gets called, jquery.js also. thickbox.js doesn't.

Lots of missing details:

  • When do you call the function?
  • Is there markup in the HTML output of your page? A script element for ThickBox?
  • If so, do you get a 404 for the URI? Does the thickbox script really exists on the remote site?
  • Any errors in your console output?

Update your question, fill in the details.

  • +1 for saying: check your details! It wasn't any of these, but it helped. :) – moraleida Mar 9 '12 at 21:57

Reposting comment as answer:

I came to find out that the theme was never calling wp_footer(); which was stupid of me not to check since i didn't write the whole theme. Thickbox always goes on the footer.


for opening thickbox where you design custom fields look and feel login box




<input class="button button-primary button-large open" type="button" value="Add" name="Addmanager">
<script type="text/javascript">
$('.open').click(function(event) {    
   tb_show("Are you sure Want To Delete ?", "<?php echo plugins_url('MOF/create-manager-login.php'); ?>?width=300&height=300&post_id=" + <?php echo $post->ID; ?>);
  • This does not answer the question. – s_ha_dum Jun 16 '15 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.