Title: Problem with conditional
Last modified: August 22, 2016

---

# Problem with conditional

 *  Resolved [Diegossc](https://wordpress.org/support/users/diegossc/)
 * (@diegossc)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/problem-with-conditional/)
 * Hi there!
 * I have this function to show some contents only to loged users:
    add_shortcode(‘
   miembro’, ‘shortcode_para_miembros’ ); function shortcode_para_miembros( $atts,
   $content = null ) { if ( is_user_logged_in() && !is_null( $content ) && !is_feed())
   return $content; return ”; }
 * The problem is when i use this filter on the front end, the shortcode for [wppb-
   login] or [wppb-edit-profile] doesn´t work, and shown as shortcode in the front-
   end Example:
 * [miembro] Form for loged users: [wppb-edit-profile] [/miembro]
 * When i put this in the front end i still get the shortcode instead of the profile
   form.
 * Can u help me?
    Regards!
 * [https://wordpress.org/plugins/profile-builder/](https://wordpress.org/plugins/profile-builder/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [adispiac](https://wordpress.org/support/users/adispiac/)
 * (@adispiac)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/problem-with-conditional/#post-5685146)
 * Hi Diego,
    It’s not working because you need to wrap the content with do_shortcode()
   like below:
 *     ```
       add_shortcode( 'miembro', 'shortcode_para_miembros');
       function shortcode_para_miembros( $atts, $content = '' ) {
           if ( is_user_logged_in() && !is_null( $content ) && !is_feed() )
               return do_shortcode($content);
           return '';
       }
       ```
   
 * Another option would be to use [Eyes Only](https://wordpress.org/plugins/eyes-only-user-access-shortcode/)
   plugin in conjunction with PB.
 * On the edit profile page you should have something like this:
 *     ```
       [eyesonly logged="in"]
       [wppb-edit-profile]
       [/eyesonly]
       ```
   
 * I’ve tested both options and they should work. Can you confirm?

Viewing 1 replies (of 1 total)

The topic ‘Problem with conditional’ is closed to new replies.

 * ![](https://ps.w.org/profile-builder/assets/icon-256x256.png?rev=2961144)
 * [User Profile Builder - Beautiful User Registration Forms, User Profiles & User Role Editor](https://wordpress.org/plugins/profile-builder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/profile-builder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/profile-builder/)
 * [Active Topics](https://wordpress.org/support/plugin/profile-builder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/profile-builder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/profile-builder/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [adispiac](https://wordpress.org/support/users/adispiac/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/problem-with-conditional/#post-5685146)
 * Status: resolved