I am trying to: show a conditional link, i.e. if the user is not logged in show them the registration link.
Link to a page where the issue can be seen: hidden link
I expected to see: A registration link top right and right nav under the stars
Instead, I got: It only shows in the page/content itself when used as a block. In the content it shows "Not registered" but that same code does not work in the header widget or sidebar widget.
Hi,
Thank you for contacting us and I'd be happy to assist.
Currently, the Toolset Blocks are not supported in the new block-based widgets editor:
https://toolset.com/errata/toolset-blocks-do-not-work-in-new-block-based-widgets-editor/
If you could share temporary admin login details, along with the exact requirements, I'll be in a better position to suggest the next steps, accordingly.
Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.
regards,
Waqar
I am trying to show certain content to logged-in users only, for example, a link that should only be displayed to a logged-in user. I'm hesitant to provide login details to my admin panel.
Thanks for writing back.
If you're hesitant to share the admin access details, perhaps you could share the screenshot from the admin area of exactly where and how you're trying to use the conditional statement.
It's within a Gutenberg block in the header of the Astra theme. I might have read somewhere that installing the classic widget plugin might fix this?
But you should be able to replicate this in your own set up while using Gutenberg and widgets.
For the dynamic login/logout/register links, you can try the third-party plugin "Login Logout Menu":
https://wordpress.org/plugins/login-logout-menu/
I've tested it in the Astra theme's header builder. You can either add these links as part of the navigation menus or simply through shortcodes:
[login_logout_menu__login_link]
[login_logout_menu__logout_link]
[login_logout_menu__register_link]
I already have those, but the issue is that the conditional code doesn't work there, any of it. The last question was whether installing that plugin to revert to the classic widget would do the trick. I will test this myself when I am in need of shortcodes in the widgets. For now I'll mark it closed.
My issue is resolved now. Thank you!