Support » Fixing WordPress » display some content in sidebar just for logged in users

  • <span><?php _e(‘university:’,’cp’);?></span> <?php echo get_the_author_meta(‘univeristy’); ?>
  • And this is what I want just to display for logged in users:

  • <span><?php _e(‘Cel:’,’cp’);?></span> <?php echo get_the_author_meta(‘celphone’); ?>
  • <span><?php _e(‘E-mail: ‘,’cp’)?></span><?php echo get_the_author_meta(‘user_email’); ?>
  • So far I know I coul use this

    <blockquote><?php if (get_option('    DONT KNOW WHAT HERE') == 'yes' && is_user_logged_in()) {
    
                            include_once( DONT KNOW IF THIS IS RIGHT );
    
                        } elseif (get_option('DONT KNOW WHAT HERE TOO ') <> 'yes'){
    
                            include_once(DONT KNOW WHAT THIS CALL );
    
                        } else {
                        ?></blockquote>
       <div class="pad25"></div>
                            <p class="contact_msg center"><strong><?php _e('You should be Looged in to see this information.', 'cp') ?></strong></p>
                            <div class="pad100"></div>
                  <?php } ?>

    THANK YOU

Viewing 1 replies (of 1 total)
  • Test this out

    <?php if (is_user_logged_in()) {//user is looged in ?>
        <span><?php _e('Cel:','cp'); ?></span>
        <?php echo get_the_author_meta('celphone'); ?>
    <span><?php _e('E-mail: ','cp'); ?></span><?php echo get_the_author_meta('user_email'); ?>
    
    <?php }else { // user is not logged in ?>
        <span><?php _e('university:','cp'); ?></span>
        <?php echo get_the_author_meta('univeristy'); ?>
    }

Viewing 1 replies (of 1 total)
  • The topic ‘display some content in sidebar just for logged in users’ is closed to new replies.