I need help with something (wordpress logout)

Discussion in 'HTML & Website Design' started by moneff, Apr 18, 2011.

  1. #1
    Hello Guys,

    I am nearly to the end of developing my website.. I can see the finish line.. :p
    But there is only problem that keeps me from publishing my very first WordPress project.

    I have spend more than 4 days of fixing this bug but I CANNOT fix it.. I really can't..
    I have read almost the whole google engine and nothing :(..

    So here is my problem..

    This is my Code...

    <?php  if (is_user_logged_in()) {
              $user = wp_get_current_user();
              echo 'Welcome <strong>'.$user->display_name.'</strong>';
    
                            } else { ?>
    
               <strong><?php wp_loginout($_SERVER['http://play-us.com/']); ?></strong>
               <a href="<?php echo get_option('home'); ?>/wp-login.php?action=register" class="simplemodal-register"><strong>Register</strong></a>
              <?php } ?>
    PHP:
    I want to add LOG OUT Right next to
    echo 'Welcome <strong>'.$user->display_name.'</strong>';
    PHP:
    I really need your help guys..

    I cannot fix this...
    This is the thins that are stopping my website of getting published.. :( And the worst things is that I have a dead line, because my google AdWords voucher is getting expired :( Which is very bad for me.. :(

    So Please guys help me out..

    THANK YOU IN ADVANCE!

    (P.S. Sorry for my bad English, but I'm still learning it)

    Best Regards,
    Simeon
     
    moneff, Apr 18, 2011 IP
  2. safiweb

    safiweb Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hey Simeon,

    Try this....

    <?php  if (is_user_logged_in()) {
              $user = wp_get_current_user();
              echo 'Welcome <strong>'.$user->display_name.'</strong>';
     } 
    ?>
    <strong><?php wp_loginout($_SERVER['http://play-us.com/']); ?></strong>                    
                           
    <?php  if (!is_user_logged_in()) { ?>
               <a href="<?php echo get_option('home'); ?>/wp-login.php?action=register" class="simplemodal-register"><strong>Register</strong></a>
     <?php } ?>
    PHP:
     
    safiweb, Apr 18, 2011 IP
  3. moneff

    moneff Member

    Messages:
    93
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    Thank you for the efford! :)

    But I have found a complete ready widget :)

    But thank you again!!! :)

    Best Regards,
    Simeon
     
    moneff, Apr 18, 2011 IP