WordPress.org

Ready to get started?Download WordPress

Forums

Suggestions for default menus in index.php (2 posts)

  1. Op
    Member
    Posted 9 years ago #

    The defaults "other" links in index.php are today "login" and "register". First I would suggest to add a "post" link, and second to change the "login" to "logout" when the user is already logged in. The other section would then be something like:


    <li id="other"><?php _e('Other:'); ?>
    <ul>
    <li><a href="<?php echo get_settings('siteurl'); ?>/wp-admin/post.php"><?php _e('Post'); ?>
    <?php get_currentuserinfo(); if ($user_ID != "") { ?>
    <li><a href="<?php echo get_settings('siteurl'); ?>/wp-login.php?action=logout"><?php _e('Logout'); echo " (".stripslashes($user_nickname).")" ?></a></li>
    <?php } else { ?>
    <li><a href="<?php echo get_settings('siteurl'); ?>/wp-login.php"><?php _e('Login'); ?></a></li>
    <?php } ?>
    <li><a href="<?php echo get_settings('siteurl'); ?>/wp-register.php"><?php _e('Register'); ?></a></li>
    </ul>
    </li>

    Cheers

  2. Michael Adams (mdawaffe)
    Member
    Posted 9 years ago #

    WordPress 1.5 ships with
    <li><?php wp_loginout(); ?></li>
    in both the classic and default sidebar.php

    That tag should do what you're looking for regarding the login/logout behavior.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.