Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember General Questions › Using Drip Content PHP Code in WordPress Pages
- This topic has 4 replies, 2 voices, and was last updated 10 years, 7 months ago by wzp.
-
AuthorPosts
-
April 5, 2014 at 11:45 pm #10618OzanMember
Hi,
What I’m trying is to use the same wordpress page to drip feed content for different membership levels. And I’m using the below code which I’ve given here in the forum.
<?php
if(wp_emember_is_member_logged_in(‘1’) || wp_emember_is_member_logged_in(‘2’))
{
Example text
}
?>
But I can’t use the above code in a wordpress page.
I’ve installed several PHP exec plugin’s but all of them are giving errors related with the syntax.
For instance, in “Shortcode Exec PHP” plugin, I add the above lines without <?php and ?> as instructed and generate a shortcode in the plugin. But when I use that shortcode in a page, I get the error below:
Parse error: syntax error, unexpected T_STRING in /home/dotcom/public_html/hamilelikcom/hamilelikformulucom/uye/wp-content/plugins/shortcode-exec-php/shortcode-exec-php-class.php(895) : eval()’d code on line 3
in which line 3 is }
I’ve tried nearly all of the php exec plugins, but non of them are working. Isn’t the above code in proper php language? How can I use the above code in a wordpress page?
Any help would be greatly welcomed.
Thanks from now.
April 5, 2014 at 11:49 pm #62140wzpModeratorAre you sure you don’t want to use the corresponding shortcodes instead?
http://www.tipsandtricks-hq.com/wordpress-membership/how-to-protect-a-section-of-a-post-or-page-88
[emember_protected for=1-2 do_not_show_restricted_msg=1]
The content goes here. this content will be hidden and only
available to members of membership level 1, and 2.
[/emember_protected]April 6, 2014 at 12:04 am #62141OzanMemberI’ve corrected the code, but this time the shortcodes of wp eMember and eStore are not working. The correct code is:
<?php
if(wp_emember_is_member_logged_in(‘1’) || wp_emember_is_member_logged_in(‘2’))
{ ?>
Example text.
<?php }
?>
But when I use [wp_eStore_download_now_button id=12] and [wp_eMember_user_details user_info=”email”] shortcodes instead of “Example text.” they remain as text.
How can I make the eMember and eStore shortcodes to work inside a wordpress page by using the above code?
April 6, 2014 at 12:15 am #62142OzanMemberwzp, THANK YOU!
I was struggling with this.
I wasn’t knowing the [emember_protected] shortcode.
This solved all of my problems. Other shortcodes works perfectly within this shortcode.
THANK YOU A LOT AGAIN!
April 6, 2014 at 12:50 am #62143wzpModerator -
AuthorPosts
- You must be logged in to reply to this topic.