How to add a new page in wordpress admin

  • 0

In functions.php  file, Add following code

add_action( ‘admin_menu’, ‘mycustompagemenu’ );

function mycustompagemenu(){
add_menu_page(
__( ‘My own Settings’, ‘textdomain’ ),
‘my theme settings’,
‘customize’,
‘mythemesettings’,
‘my_theme_settings_fun’,
get_template_directory_uri().’/images/icon.png’,
60
);
}

function my_theme_settings_fun(){
esc_html_e( ‘Admin Page’, ‘textdomain’ );
}

 

For more details

 

add_menu_page()

In functions.php  file, Add following code add_action( ‘admin_menu’, ‘mycustompagemenu’ ); function mycustompagemenu(){ add_menu_page( __( ‘My own Settings’, ‘textdomain’ ), ‘my theme settings’, ‘customize’, ‘mythemesettings’, ‘my_theme_settings_fun’, get_template_directory_uri().’/images/icon.png’, 60 ); } function my_theme_settings_fun(){ esc_html_e( ‘Admin Page’, ‘textdomain’ ); }   For more details   add_menu_page()

In functions.php  file, Add following code add_action( ‘admin_menu’, ‘mycustompagemenu’ ); function mycustompagemenu(){ add_menu_page( __( ‘My own Settings’, ‘textdomain’ ), ‘my theme settings’, ‘customize’, ‘mythemesettings’, ‘my_theme_settings_fun’, get_template_directory_uri().’/images/icon.png’, 60 ); } function my_theme_settings_fun(){ esc_html_e( ‘Admin Page’, ‘textdomain’ ); }   For more details   add_menu_page()

Leave a Reply

Your email address will not be published. Required fields are marked *