Title: Php code
Last modified: August 22, 2016

---

# Php code

 *  Resolved [kingsparadise](https://wordpress.org/support/users/kingsparadise/)
 * (@kingsparadise)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/php-code-30/)
 * Nice plugin, how can i integrate this plugin in the header.php because it only
   generate short code no php code.
 * [https://wordpress.org/plugins/eyes-only-user-access-shortcode/](https://wordpress.org/plugins/eyes-only-user-access-shortcode/)

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [thomstark](https://wordpress.org/support/users/thomstark/)
 * (@thomstark)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/php-code-30/#post-5361984)
 * `<?php echo do_shortcode('[eyesonly]stuff[/eyesonly]'); ?>`
 *  Thread Starter [kingsparadise](https://wordpress.org/support/users/kingsparadise/)
 * (@kingsparadise)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/php-code-30/#post-5362131)
 * 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
 *  Plugin Author [thomstark](https://wordpress.org/support/users/thomstark/)
 * (@thomstark)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/php-code-30/#post-5362132)
 * You’re calling `<?php` inside a `<?php` tag which will give you an error. The
   following is correct:
 * `<?php echo do_shortcode('[eyesonly hide="yes" logged="in"]'.masterslider(2).'[/
   eyesonly]'); ?>`
 *  Thread Starter [kingsparadise](https://wordpress.org/support/users/kingsparadise/)
 * (@kingsparadise)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/php-code-30/#post-5362134)
 * 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]'); ?>`
 *  Plugin Author [thomstark](https://wordpress.org/support/users/thomstark/)
 * (@thomstark)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/php-code-30/#post-5362137)
 * Turn off administrator override in your eyes only settings. It’s probably working
   just fine for everyone but you.
 *  Thread Starter [kingsparadise](https://wordpress.org/support/users/kingsparadise/)
 * (@kingsparadise)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/php-code-30/#post-5362138)
 * 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”&gt](http://ezexcomm.net/wp-content/uploads/2014/10/snapshot-1170×516.png”&gt);
 *  Thread Starter [kingsparadise](https://wordpress.org/support/users/kingsparadise/)
 * (@kingsparadise)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/php-code-30/#post-5362139)
 * maybe i can give you access to the admin end of the site, the site is still under
   development
 *  Plugin Author [thomstark](https://wordpress.org/support/users/thomstark/)
 * (@thomstark)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/php-code-30/#post-5362140)
 * 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]');?
   >`
 *  Thread Starter [kingsparadise](https://wordpress.org/support/users/kingsparadise/)
 * (@kingsparadise)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/php-code-30/#post-5362141)
 * You made my day. Thanks so much .You are the best

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Php code’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/eyes-only-user-access-shortcode_f1f0ef.
   svg)
 * [Eyes Only: User Access Shortcode](https://wordpress.org/plugins/eyes-only-user-access-shortcode/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/eyes-only-user-access-shortcode/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/eyes-only-user-access-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/eyes-only-user-access-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/eyes-only-user-access-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/eyes-only-user-access-shortcode/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [kingsparadise](https://wordpress.org/support/users/kingsparadise/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/php-code-30/#post-5362141)
 * Status: resolved