add page to main menu (frontend)

I’m trying to add a page to main menu (frontend).

Here is what I tried:

public function paginaAMenu($page){
$menu_check = menu_page_url($page->slug, 0);

if($menu_check == “”){
$menu = add_menu_page($page->title, $page->title, ‘read’, $page->slug);

But nothing happens. Maybe I miss what add_menu_page is for and I would like to know how to achieve my goal.

Read more here:: add page to main menu (frontend)

Leave a Reply

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