• Plans & Pricing
  • Log in
  • Get started
  • WordPress Hosting
  • WordPress for Agencies
  • Become an Affiliate
  • Domain Names
  • AI Website Builder
  • Website Builder
  • Create a Blog
  • Newsletter
  • Professional Email
  • Website Design Services
  • Commerce
  • WordPress Studio
  • Enterprise WordPress 
  • Overview
  • WordPress Themes
  • WordPress Plugins
  • WordPress Patterns
  • Google Apps
  • Support Center
  • WordPress News
  • Business Name Generator
  • Logo Maker
  • Discover New Posts
  • Popular Tags
  • Blog Search
Get started
  • Sign up
  • Log in
About
  • Plans & Pricing
Products
  • WordPress Hosting
  • WordPress for Agencies
  • Become an Affiliate
  • Domain Names
  • AI Website Builder
  • Website Builder
  • Create a Blog
  • Newsletter
  • Professional Email
  • Website Design Services
  • Commerce
  • WordPress Studio
  • Enterprise WordPress  
Features
  • Overview
  • WordPress Themes
  • WordPress Plugins
  • WordPress Patterns
  • Google Apps
Resources
  • Support Center
  • WordPress News
  • Business Name Generator
  • Logo Maker
  • Discover New Posts
  • Popular Tags
  • Blog Search
Jetpack App
  • Learn more
  • Support Center
  • Guides
  • Courses
  • Forums
  • Contact
Search
  • Support Center
  • Guides
  • Courses
  • Forums
  • Contact
Forums / External wp-loginout and wp-meta Functions

External wp-loginout and wp-meta Functions

  • Unknown's avatar
    coreymccown · Member · Mar 12, 2011 at 3:56 am
    • Copy link Copy link
    • Add topic to favorites Add topic to favorites

    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!

  • Unknown's avatar
    coreymccown · Member · Mar 12, 2011 at 3:58 am
    • Copy link Copy link

    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!

  • Unknown's avatar
    timethief · Member · Mar 12, 2011 at 4:39 am
    • Copy link Copy link

    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.

    Tags

    • coding external functions wp_login wp_meta help
    • wordpress.org

    About this topic

    • In: Support
    • 2 participants
    • 2 replies
    • Last activity 15 years
    • Latest reply from coreymccown

    Couldn't find what you needed?

    Contact us

    Contact us

    Get answers from our AI assistant, with access to 24/7 expert human support on paid plans.

    Browse our guides

    Browse our guides

    Find step-by-step solutions to common questions in our comprehensive guides.

    WordPress.com

    Products
    • WordPress Hosting
    • WordPress for Agencies
    • Become an Affiliate
    • Domain Names
    • AI Website Builder
    • Website Builder
    • Create a Blog
    • Professional Email
    • Website Design Services
    • WordPress Studio
    • Enterprise WordPress
    Features
    • Overview
    • WordPress Themes
    • WordPress Plugins
    • WordPress Patterns
    • Google Apps
    Resources
    • WordPress.com Blog
    • Business Name Generator
    • Logo Maker
    • WordPress.com Reader
    • Accessibility
    • Remove Subscriptions
    Help
    • Support Center
    • Guides
    • Courses
    • Forums
    • Contact
    • Developer Resources
    Company
    • About
    • Press
    • Terms of Service
    • Privacy Policy
    • Do Not Sell or Share My Personal Information
    • Privacy Notice for California Users
    DeutschEspañolFrançaisBahasa IndonesiaItalianoNederlandsPortuguês do BrasilSvenskaTürkçeРусскийالعربيةעִבְרִית日本語한국어简体中文繁體中文English

    Mobile Apps

    • Download on the App Store
    • Get it on Google Play

    Social Media

    • WordPress.com on Facebook
    • WordPress.com on X (Twitter)
    • WordPress.com on Instagram
    • WordPress.com on YouTube

    Automattic

    Automattic
    Work With Us
      • WordPress.com Forums
      • Sign up
      • Log in
      • Copy shortlink
      • Report this content
      • Manage subscriptions