Skip Navigation

[Resolved] Conditional Outputs

This support ticket is created 7 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 7 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#576261
2017-10-04 14_43_40-Epicurean Recipes – A Recipe Website with High Variety of Food.jpg

hi, so I have a little user section in my header. It contains basically looks like this:

Welcome [wpv-user field="user_login"] | [wpv-logout-link]Logout[/wpv-logout-link] | Login | Register

Q1: How can I hide the Welcome text when the user isn't logged in?
Q2: How can I hide the Register and Login text when the user is logged in?

Thank you. You guys are the best. I'm very happy with your product.

#576377

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - you can use [wpv-conditional] shortcode to output the conditional content.

- output content if user is loggedin:

[wpv-conditional if="('[wpv-current-user info='id']' ne  '')"]
user is  LOGGEDIN - add your content here
[/wpv-conditional]

- output content if user is NOT loggedin
[php]
[wpv-conditional if="('[wpv-current-user info='id']' eq  '') "]
user is NOT logged in - add your content here
[/wpv-conditional]

Please have look at following documentation that may help you:
=> https://toolset.com/documentation/views-shortcodes/#wpv-current-user
=> https://toolset.com/documentation/user-guides/conditional-html-output-in-views/