Hi all, first time posting here.
When a user logs-in to the site it doesn’t look like it was successful but it actually was. I have three menu items for the home page (logged-out status) – Home, Courses, Login
​
https://preview.redd.it/axcdqe7yjpkc1.png?width=358&format=png&auto=webp&s=21801fc1a8fae1642b708e5934d5a3d82fe7d30b
When a user logs-in it remains these three, even though it should show – Home, Courses, My Account, Logout
I am using the Nav Menu Roles plugin to control this behavior.
I have LearnDash installed and this provides the mechanism for logging-in.
Frustratingly, once logged-in, even though the home page menu doesnt change, when I click into Courses, the menu changes.
https://preview.redd.it/lxsit9i1kpkc1.png?width=426&format=png&auto=webp&s=1e3af08f9a63a0234baed25832ac32ba6c2df805
After about 2 minutes, when I click back into home, the menu is as it should be, like there is a delay in updating the menu for the home page when a user logs in.
​
https://preview.redd.it/tdylnlhbkpkc1.png?width=409&format=png&auto=webp&s=a2ec18ec4d9fa41e8296a2c4d68db29a9730958b
Has anyone had a similar issue and how did you resolve? Let me know if I can provide and further information. Any help is greatly appreciated.
​
[ad_2]
I had “fixed” a similar issue a while ago with a little JavaScript. Basically the JS looks for a CSS class “logged-in”. If the class is present, hide menu item “Login” and show “My Account” and “Logout”. If the class is not present, do the opposite. This will work if all the items are part of the same menu. The pro of this approach is that JS eliminates any issues with caching. The con is that it adds a little extra JS to the frontend, and if the JS is deferred then the user may see the “switch” happening.