- This topic has 1 reply, 1 voice, and was last updated 11 years, 4 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP eMember › Adding shortcode to the body breaks page protection
Tagged: protection, shortcode, wp membership
Hi there,
What I’m running: Latest Genesis
What I did: Created a short code call in the body of the page I’m trying to protect.
Why: The skin of the page IS the protected content. Everything is in there. So the “content to protect” is everything, and because I assumed the BODY is what gets locked down by the membership plugin, I did this. (Nothing else worked either)
What happened: The shortcode gets displayed – aka ALL the content – without me needing to be logged in, and then BELOW it, there is a login link.
There’s gotta be some way around this. Is this a glitch?
HELP!!!
Thank you.
I figured it out!
Hopefully my hell will be helpful to someone:
You have to initiate shortcodes before they are used right? So any place before or in the loop.
I was missing something simple I couldn’t understand that caused the shortcodes to fire off before the login was initiated.
All I had to do was the following:
if (wp_emember_is_member_logged_in()) { add_action( ‘genesis_before_loop’, ‘register_shortcodes’); }
That’s it!