WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 added a menu item to the Appearance menu in the admin area using add_theme_page(). Is there a way to add a class or id to it so I can style it?

I just want to change the font color a little, but I don't want to use any "ul:nth-child(2)" kind of stuff, especially since other plugins add themselves to that menu.

share|improve this question
If you know the URL you can try a css selector based on attribute, checking for exact match like a[href="http://example.com"] or checking if contains string like a[href*="example.com"] – czerspalace Sep 21 '15 at 23:31
I was able to do it by adding and id directly to the menu title in the function like this: function theme_name_my_admin_menu() { add_theme_page( 'Upgrade to Theme Name Premium', '<span id="premium-link">Premium Options</span>', 'manage_options', '/premium.php', 'theme_name_premium_options_page'); } add_action( 'admin_menu', 'theme_name_my_admin_menu' ); – Derek Dec 1 '15 at 22:10

Your Answer


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

Browse other questions tagged or ask your own question.