Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Am I smoking crack or why wouldn't this work? :/ This all seems pretty straightforward:

function admin_head()
{

?>
<link type="text/css" rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/jquery-ui-1.8.9.custom.css"  />
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery-ui-1.8.9.custom.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/theme-admin.js"></script>
<?php

}

add_action('admin_head', "admin_head");

And then in theme-admin.js ...

jQuery(document).ready(function($)
{   
    $("#datepicker").datepicker({
        changeMonth: true,
        changeYear: true, dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: plugin_path + '/images/icon-datepicker.png', buttonImageOnly: true});

});

Thank you for any insight you can provide :) Cheers

share|improve this question

2 Answers 2

You might also want to look at using wp_enqueue_script and wp_enqueue_style, rather than echoing those script & style tags. Using these functions helps to eliminate duplicate scripts and styles, as well as introducing some dependency support.

share|improve this answer
up vote 0 down vote accepted

Duh, if you're image path is bust and it's the only way it activates, it just won't load.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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