Site logo

Archived topic

Need navigation to share one link

3 replies · Started by Michelle on July 24, 2022

Viewing posts 1–4 of 4

I have a membership plugin that provides a navigation login/logout function that looks like this when you put it into the menu: #daploginout#
It is a php function (I think) that changes from login to logout according to a member's logged in or logged out status.

I created a generate_menu_bar_item in Elements, and put in #daploginout# where the "#" is in this code, hoping it might work:


<span class="menu-bar-item">
    <a href="#daplogin/out#"</a>
</span>

Then I created a generate_menu_item "Login" using this code, but still didn't know how to make it use the #daplogin/out#


<span class="menu-bar-item">
    <a href="#">Login&nbsp&nbsp</a>
</span>

I used the generate_menu_bar_item because the link shows on mobile as well as on desktop and tablet. Also because it lets me share the same link on my primary menu as on this custom page.

I saw in Elements that I could show different navigation to logged in and logged out users. Very cool functionality. Could this be used in some way to achieve a login/logout function?

Or--is there a way to use the primary navigation and somehow leave only the login/logout visible?

I'm not being cheap or lazy. I already created a multi-site subdomain so it could share the login, but the login/logout situation became very buggy. I also created a completely different site and purchased extra licenses for all of the plugins and themes I use. I paid an app developer several thousand dollars to create an app that did not work with the login like I wanted, so I'm determined to not quit now. I am mediocre at best with coding, obviously, but am understanding more all the time. I study ancient languages, not code, and this tedious learning curve has been going on since last October. I have so many hours and $ into this.

Any help is appreciated.

Hi Michelle,

To clarify, are you referring to showing either the login or logout button depending on if the user/customer is logged in or out?

May we know how your membership login/logout works? Does this #daplogin/out# work with any other theme?

Kindly let us know.

Yes, it works on all themes to show whether a user is logged in or out. It's a widget. It is currently on my primary menu but I need it to show by itself on one page. I don't know how to make other primary nav items disappear. I thought adding it somehow in Elements as a generate_menu-item could work.

The description is:

"DAP has a Login/Logout Widget that you can use in any widget-ready theme.

Log in as WP admin, and look under “Appearance > Widgets”.

You’ll see the widget. Drag this widget on to any customizable part of your theme.

The widget puts the DAP login form right on your sidebar.

When a user is not logged in, they will see the login form.

When they are logged in, they just see a “Logout” button."

I see. Thank you for clarifying.

Can you also clarify this line a bit more “Or–is there a way to use the primary navigation and somehow leave only the login/logout visible?”. Are you wanting like a mobile/hamburger menu for all views so that the menu is somewhat hidden when not toggled? If so, you can go to Appearance > Customize > Layout > Primary Navigation and set a high value for Mobile Menu Breakpoint such as 2000px.

Kindly let us know.

This archived topic is closed to new replies.