You are currently viewing create custom page in wordpress admin

create custom page in wordpress admin

Create custom page in wordpress admin panel using menu and display data after visiting that link. Add below code to function.php of child’s theme and you will be able to see Promote link in wp-admin.

//Add menu to wp-admin
add_action( 'admin_menu', 'my_admin_menu' );
function my_admin_menu() {
	add_menu_page( 'Promote', 'Promote', 'manage_options', 'promote', 'promote_function', '', 5 );
}

//call below function after clicking Promote menu
function promote_function(){
	require 'promote.php';
}

//promote.php file with some login
echo 'test';

Above code will display “test” as output on Promote page.

Leave a Reply