• I have been creating a website for about 2 weeks now. I am trying to create two buttons in my header for logging in/out and also a site admin button. These two functions are wp-loginout and wp-meta. The code I have is:

    <?php
    require('./blog/wp-load.php');?>
    <li>
    <?php wp_loginout();?>
    </li>
    <li>
    <?php wp_meta();?>
    </li>

    I do not use the require once method because I use functions from WordPress in other areas of my website. The button works fine, but sadly, it does not recognize when I am logged in. No matter what, it says Log In and Register. This is very frustrating and I have searched Google for hours trying to find a solution. A secondary method I tried was:

    <?php if (is_user_logged_in()) : ?>
        <li><a href="<?php echo wp_logout_url(get_permalink()); ?>">Logout</a></li>
    <?php else : ?>
        <li><a href="<?php echo wp_login_url(get_permalink()); ?>">Login</a></li>
    <?php endif;?>

    This had the same problem as the other code. Please help me, I am all out of ideas. Any suggestions are much appreciated. If you want to get a look for yourself, you can visit my site at: http://www.coreymccown.com/

    Thanks again!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘External wp-loginout and wp-meta Functions’ is closed to new replies.