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.

I know I can use enqueue_script and enqueue_style to register scripts and stylesheets, however I'm trying to print out just the link to the adminbar css:

<link rel='stylesheet' id='admin-bar-css' \
href='http://mysite.com/wp-includes/css/admin-bar.css?ver=20111209' type='text/css' media='all' />

I could just include that text on my page but I was hoping for something like

wp_print_script('admin-bar-css')

Is there such a thing?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

to print a single style:

wp_print_styles('admin-bar');

to print a single script:

wp_print_scripts('admin-bar');

note that the handle must be registered first using wp_register_style() or wp_register_script().

http://codex.wordpress.org/Function_Reference/wp_register_script http://codex.wordpress.org/Function_Reference/wp_register_style

share|improve this answer
    
thx. i also found this helpful: wp_print_scripts('jquery'); –  cwd Mar 8 '12 at 3:09
    
i think you have a typo in your print script syntax –  cwd Mar 8 '12 at 3:23
    
you mean, wp_print_styles doesn't also print scripts? copy, paste FAIL. fixed. thanks. –  helgatheviking Mar 8 '12 at 3:26

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.