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 want to add a top level link to the theme settings page in the WordPress dashboard menu. If I use the add_theme_page function, then it works correctly, but if I add the link to the dashboard menu, it does not load the styles.

Please see the following code:

This works fine: It adds link on the themes page and load style correctly:

function add_dashboard_menu_links() {
add_theme_page( __( 'Settings', 'domain' ), __( 'Settings', 'domain' ), 'edit_theme_options', 'theme-settings', 'settings_page_function' );
}

add_action( 'admin_menu', 'add_dashboard_menu_links');

This does not work: It adds link to the dashboard and on themes page, but it does not load stylesheet for any of them:

function add_dashboard_menu_links() {
add_theme_page( __( 'Settings', 'domain' ), __( 'Settings', 'domain' ), 'edit_theme_options', 'theme-settings', 'settings_page_function' );
add_menu_page('Settings', 'Settings', 'manage_options', 'theme-settings', 'settings_page_function', $icon);
}

add_action( 'admin_menu', 'add_dashboard_menu_links');

I must be doing something wrong, whats the right way to add link to the WordPress dashboard menu?

share|improve this question
1  
What stylesheet? You are not loading a stylesheet in any of your above code. –  t31os Jun 14 '13 at 11:10
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.