• Hi,

    I would like my blog to display a button for registering to my site, and once logged in a button for viewing their profile so users can update their password etc..

    I’ve used this code in my functions.php to display the Log In & Log out function in my menu bar is there a similar sort of code for a Register button aswell as a profile button?

    add_filter('wp_nav_menu_items', 'add_login_logout_link', 10, 2);
    function add_login_logout_link($items, $args) {
            ob_start();
            wp_loginout('index.php');
            $loginoutlink = ob_get_contents();
            ob_end_clean();
            $items .= '<li>'. $loginoutlink .'</li>';
        return $items;
    }

    P.s the Profile button would need to be for logged in users only.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How to add a register & profile button’ is closed to new replies.