-
Author
-
October 10, 2015 at 09:28 #81687VanessaParticipant
Is it possible to hide/show shortcode based on whether the user is logged in or not?
I’ve got a login prompt that is made using a shortcode from the visual editor that I’d like to hide if the user is logged in. This prompt is in a widget – I’d like to do it in a widget and a post (menu is clear enough how to do)thx
vOctober 12, 2015 at 19:25 #81900LauraModeratorHello, yes it is possible, could you share a link and show me what do you want to hide? 🙂
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
October 12, 2015 at 19:31 #81902RaduModeratorHi,
See this small video : https://drive.google.com/file/d/0Bxo5b6iHWRMwMUZpa2RpeW1xUG8/view
COPY CODE[kleo_restrict type="guest"]<h1>This text will be displayed only for guest users </h1>[/kleo_restrict]
Best Regards
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionOctober 18, 2015 at 23:24 #83064VanessaParticipantRadu you are a magician! Thank you!
Is there a way to restrict based on user levels defined by paid memberships pro?My scenario is – I want to show an upsell prompt ‘get our more awesome plan’ to users at a lower tier, even though they are logged in.
October 19, 2015 at 19:04 #83208RaduModeratorHi,
Please take a look,test and adapt this snippet for your requirements
COPY CODE//1,2 represents id's of packages that you want to see your message function CheckMemberships() { if(pmpro_hasMembershipLevel(array(1,2), get_current_user_id())){ echo 'Please update your account to GOLD membership <a href="/">Link</a>' ;} } add_action('wp_head', 'CheckMemberships');
Add this code to your kleo-child/functions.php
Best Regards
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionOctober 25, 2015 at 02:28 #84061VanessaParticipantThanks, is there a way to have the same shortcode behavior for PMPRO membership levels?
[kleo_restrict type="Gold"]<h1>This text will be displayed only for gold users </h1>[/kleo_restrict]Also, for logged in users I’m using [kleo_restrict], but it seems to be missing an argument. What should I use for the argument?
October 26, 2015 at 15:50 #84252RaduModeratorHi,
COPY CODEShortcode Examples [membership] Will show up for all members [/membership] [membership level="1"] Will only show up for level 1 users [/membership] [membership level="1,2,3"] Only show for level 1, 2, or 3 users [/membership] [membership level="0,-1"] Show for anyone not in level 1, including non-members and visitors. [/membership] [membership level="0"] Will show up for non-members and non-logged in site visitors. [/membership]
Source: http://www.paidmembershipspro.com/documentation/content-controls/with-shortcodes/
If you want to see the page, you need to have an account, you can create one is free.Regards
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionOctober 31, 2015 at 09:11 #85180VanessaParticipantOh perfect! I didn’t think to look at PMP Pro documentation, I was looking for this somewhere on the Kleo Docs.
This is awesome, thanks.
Are you folks looking at updating the Kleo Docs? Might be worth adding a few links to the tools (RTMedia, PMP, …) that you include.
Thanks for your help Radu!
November 3, 2015 at 19:11 #85525RaduModeratorHi,
You’re welcome
Yes in future we will update the documentation.
Regards
RAdu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.