• Hi,

    I have removed my admin bar in admin with css.
    And now I trie to add two menu button on the sidemenu.

    the code is like this:

    function add_site_to_menu(){
    	$link = site_url();
        add_menu_page( __('Tillbacka till sida', 'Tillbacka till sida'), __('Tillbacka till sida', 'Tillbacka till sida'), 'edit_themes', $link, '', 95 );
    }
    add_action('admin_menu', 'add_site_to_menu');
    
    function add_logout_to_menu(){
    	$link = wp_logout_url(get_permalink());
        add_menu_page( __('Logga ut', 'Logga ut'), __('Logga ut', 'Logga ut'), 'edit_themes', $link, '', 99 );
    }
    add_action('admin_menu', 'add_logout_to_menu');

    It show up but i got this message:

    Forbidden
    You don’t have permission to access /localhost:8080 on this server.

    I know what is wrong.
    It send me to this url: http://localhost:8080/localhost:8080
    It should send me to this url: http://localhost:8080/
    How can I solve this problem?

    Many thanks/
    Granskog

Viewing 1 replies (of 1 total)
  • Thread Starter granskog

    (@granskog)

    Hi agian,

    I have solved the problem with forbidden with this code:

    function new_nav_menu () {
        global $menu;
        $menu[600] = array('Profil', 'read', admin_url( 'profile.php' ), 'icon', 'menu-top menu-nav');
        $menu[700] = array('Tillbaka till sidan', 'read', site_url(), 'icon', 'menu-top menu-nav');
        $menu[800] = array('Logga ut', 'read', wp_logout_url(), 'icon', 'menu-top menu-nav');
    }
    add_action('admin_menu', 'new_nav_menu');

    But now I whant them to open in a new window,
    how can I do that?

    Many thanks/
    Granskog

Viewing 1 replies (of 1 total)

The topic ‘admin menu’ is closed to new replies.