Php code
-
Nice plugin, how can i integrate this plugin in the header.php because it only generate short code no php code.
https://ww.wp.xz.cn/plugins/eyes-only-user-access-shortcode/
-
<?php echo do_shortcode('[eyesonly]stuff[/eyesonly]'); ?>thanks for the quick response,
i have try using the php code above is not working` this is what i did
NOTE: my aim is to show the master sliders to only logout users or guests but hide when i user login.<?php echo do_shortcode(‘[eyesonly hide=”yes” logged=”in”]
<?php masterslider ( 2 ); ?>
[/eyesonly]’) ; ?><!— master slider function starts here —->
<?php if( function_exists( ‘masterslider’ )): ?>
<?php masterslider ( 2 ); ?>
<?php else: ?><div class=”main_graphic”>
<div class=”main_graphic_inner”> …then i try this, it hide the master sliders to both logged and logout users
<?php if( function_exists( ‘do_shortcode’ )): ?>
<?php echo do_shortcode(‘[eyesonly hide=”yes” logged=”out”]
<?php masterslider ( 2 ); ?>
[/eyesonly]’) ; ?>
<?php else: ?><!— master slider function starts here —->
<?php if( function_exists( ‘masterslider’ )): ?>
<?php masterslider ( 2 ); ?>
<?php else: ?><div class=”main_graphic”>
<div class=”main_graphic_inner”>please help me out
You’re calling
<?phpinside a<?phptag which will give you an error. The following is correct:<?php echo do_shortcode('[eyesonly hide="yes" logged="in"]'.masterslider(2).'[/eyesonly]'); ?>I don’t know what I’m doing wrong i use the code above and the slider shows for both logged in and logged out users,in fact i removed all the slider function and the <div class tag and use only this yet it kept showing for both users
<?php echo do_shortcode('[eyesonly hide="yes" logged="in"]'.masterslider(2).'[/eyesonly]'); ?>Turn off administrator override in your eyes only settings. It’s probably working just fine for everyone but you.
yes i did that, i even created a new user account as a subscriber to test it yet is is showing for both users. this is the screen shot of the admin setting http://ezexcomm.net/wp-content/uploads/2014/10/snapshot-1170×516.png”>
maybe i can give you access to the admin end of the site, the site is still under development
All working. After some troubleshooting, I discovered that calling the masterslider() function itself would always display the slider, but if you use the [masterslider] shortcode, Eyes Only is able to do its job.
First I tested this:
[eyesonly logged="out"]Test[/eyesonly]and that worked fine. Eventually I figured out that Master Slider was the issue. This is the working final result in your header.php:<?php echo do_shortcode('[eyesonly logged="out"][masterslider id="1"][/eyesonly]'); ?>You made my day. Thanks so much .You are the best
The topic ‘Php code’ is closed to new replies.