mercredi 9 mars 2016

Adding the custom page with add_menu_page function on Wordpress

I am using the add_menu_page function on Wordpress, this is the code;

function my_admin_menu() { add_menu_page( 'My Top Level Menu Example', 'Top Level Menu', 'manage_options', 'example.php', 'myplguin_admin_page', 'dashicons-tickets', 6 ); }

then the example.php file:

function display_text() {

echo'Welcome to my page'

}

I get the menu in the dashboard but the issue is having content on the page, I can click the option top level page from the dashboard but once I do that I just get an empty page where it should say 'Welcome To My page'

Any Ideas on how to get my content to show?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire