Viewing 1 replies (of 1 total)
  • Plugin Author Chad Butler

    (@cbutlerjr)

    The answer kind of depends on what you want (which also determines ease of implementation and complexity).

    A link to log in or log out by itself is nothing more than creating a menu item for those things. Not very elegant, but purpose serving.

    WP menus are not inherently dynamic unless you apply code snippets. Unlike the main content area and other areas of a WP site/template, you can’t ordinarily run shortcodes in a WP menu (although there are plugins that do create this ability). If you use a menu shortocode plugin, then you could use one or a combination of the plugin’s shortcodes to create the behavior you want (in fact there is a [wpmem_loginout] shortcode).

    I did write a tutorial post that is available for premium support subscribers that implements jQuery to dynamically display “log in” vs “log out” depending on the user state. That article is here:
    https://rocketgeek.com/tips-and-tricks/use-jquery-to-create-a-log-inlog-out-menu-link/

    Also, there is the Logged In Menus extension that creates clones of all of a theme’s menu areas so that there is a menu for the logged in state and one for the logged out state. That extension is currently available to support site subscribers. However, I am going to discontinue that particular extension in favor of implementing it in the main (freely available) plugin, so if that were the only reason you would sign up for premium support, you could just hold off and it will be part of version 3.2.0 (the current build, although not guaranteed to be stable, is available on bitbucket and github).

Viewing 1 replies (of 1 total)

The topic ‘Login link’ is closed to new replies.