Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #179592

    Hi,

    Would this be compatible with Enfold? I was told it works with WP menus. Not sure if Enfold uses WP menus.

    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;
    }

    thanks,

    #180110

    Hey yukanl!

    I tried that code locally, it works.

    Cheers!
    Josue

    #180164

    thanks!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘login/logout links’ is closed to new replies.