Using conditional logic in shortcode to direct users according to whether they're logged in or out

Hello,

I was wondering if there is a way to implement conditional logic related to call to action buttons that direct users to a different page on the site depending on their membership privileges.

The website in question is http://grandcayman.capital.

I would like to include the conditional logic on the homepage of my site for the blue “Learn More” call to action button that redirects users to the following link:

H T T P S://grandcayman.capital/about/#expertise

Presently, in order to get around the issue that a page using one-page navigation (the one above) can only have one menu-bar associated with it (presently, I have two menu bars using the Members Only plugin – one for users who are logged into the site, and one for users who are not logged in), I have duplicated the page above, which is located at the following url:

https://grandcayman.capital/about-us/

H T T P S://grandcayman.capital/about: For visitors to the site who are not logged in
H T T P S://grandcayman.capital/about-us/: For visitors to the site who are members and logged in

I hope to use conditional logic for the “Lean More” button on the homepage above so that users are directed to the two pages above according to their membership privileges. The obvious purpose of this is to ensure that the menu bar they see at the top of the page corresponds with their membership privileges. This is important because I don’t want users who are logged in to get confused when they see the User Dashboard link in the nav bar disappear if they decide to browse the site and click that “Learn More” button on the homepage while they are logged in.

Any thoughts on this issue? Thanks a lot!

Hello There,

Thanks for writing in! Regretfully there isn’t an option that you can use to have a logical conditions for your button. You may need 3rd party plugins to do this. Perhaps this link might help you: https://wordpress.org/plugins/search/logged+in/

Please understand that our support only covers getting your site setup, bug fixes and minor cosmetic changes. Any modifications that is not a feature or enhancement of the element or theme is already custom development. We would highly recommend that you seek help from a developer instead.

Thank you for your understanding.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.