WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to add a stylesheet to the options page for my plugin - code looks like this:

add_action( 'admin_print_styles-rps-paypal', 'rps_paypal_add_css' );

function rps_paypal_add_css() {
wp_enqueue_style( 'rps_paypal', plugins_url( '/rps_paypal/css/rps-paypal.css' ) );

add_action( 'admin_menu', 'rps_myplugin_add_page' );

function rps_myplugin_add_page() {
    'My PayPal Plugin',
    'My PayPal Plugin',

Can't figure out why it's not showing up...

share|improve this question
admin_print_styles should not be used to enqueue styles or scripts on the admin pages. Use admin_enqueue_scripts instead. – gurung Aug 25 '15 at 6:23
up vote 1 down vote accepted

the call to add_options_page will return the string literal to use for your RSS, so it should look something like this:

$page = add_options_page( ... );
add_action( 'admin_print_styles-' . $page, 'rps_paypal_add_css' );

More info here: http://codex.wordpress.org/Function_Reference/wp_enqueue_style

share|improve this answer
Hi Kovshenin, that did it! Many thanks. – Richard Sweeney Apr 29 '11 at 11:37
You're welcome Richard. What Rast said below is true as well, you shouldn't hard-code your plugin name during the call to plugins_rss. – kovshenin Apr 29 '11 at 11:39

First I am not sure you get hook suffix right. It is return of add_options_page() function and from quick test should be something like admin_page_rps-paypal in your case. But really you should save that return in the variable and use that rather than hardcode it.

Second your plugins_url() usage is little off, your plugin's folder name is not guaranteed to be that. More robust to use it like:

plugins_url('/css/rps-paypal.css', __FILE__);
share|improve this answer
Hi Rarst, Thanks so much for this - this is my first attempt at writing a plugin so all advice is greatly appreciated! - R – Richard Sweeney Apr 29 '11 at 12:07

Your Answer


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.