- This topic has 1 reply, 2 voices, and was last updated 9 years, 1 month 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 › WP eMember Tweaks › eMember – php tags within shortcode of template files
I need to protect partial content of a custom page template that has php tags within short codes. Any idea how to tweak this ?
<?php do_shortcode(‘[emember_protected]
…..report/?id=<?php echo get_the_ID(); ?>…..
[/emember_protected]’); ?>
Normally the “do_shortcode” function would do the job but in this case it won’t work for you.
There are code examples in the following page that should allow you to come up with a solution:
https://www.tipsandtricks-hq.com/wordpress-membership/wp-emember-miscellaneous-tweaks-248
you should be able to wrap that section around an “if” condition that checks if the member (of a particular level) is logged into the system then show the content (otherwise hide it).