External wp-loginout and wp-meta Functions
-
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’);?>- <?php wp_loginout();?>
- <?php wp_meta();?>
‘
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()) : ?>- “>Logout
<?php else : ?>
- “>Login
<?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!
-
I apologize for the confusing post above. The code did not post correctly. This is the fixed post:
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!
-
Your site is not hosted on WordPress.COM and you are posting to the wrong support forum. This forum is for support of sites hosted on WordPress.COM.
Your support questions must be posted to the correct support site for your software and that is here http://wordpress.ORG/support/For more on the differences pleas read: http://support.wordpress.com/com-vs-org/
- The topic ‘External wp-loginout and wp-meta Functions’ is closed to new replies.