• 8,156 views Oct 13, 2006

    The built in ‘wp_loginout’ function is hard-coded to display either a ‘Login’ or a ‘Logout’ link. If you want to display different wording, you’re out of luck, until now. The jpf_loginout function allows you to determine what text is displayed as the link for logging in or out. It also allows you to include what text or coding you want included before or after the link. The plugin accepts the following parameters:

    jpf_loginout ( '<before>;', '<after>', '<login>', '<logout>')

    If you don’t specify any parameters (ie. just put jpf_loginout()) it will behave the same as wp_loginout, that is it won’t include anything before or after the link, and the link will either say ‘Login’, or ‘Logout’.

    Let’s say you want to include a login/logout link in your sidebar, along with some of the other plugins you have. You could use it like this:

    <?php jpf_loginout ('<li>', '</li>', 'Log Me In!', 'Log Me Out!'); ?>

    Maybe you want to include it somewhere else in your page, but just want the links to say something different:

    <?php jpf_loginout ('', '', 'Let me in', 'Let me out'); ?>

    or

    <?php jpf_loginout ('<p>', '</p>', 'Log On', 'Log Off'); ?>

    Want more control over how the link is formatted? Wrap it in a <div> so you can control it with CSS:

    <?php jpf_loginout ('<div class="login">', '</div>', 'Lemme in!', 'Lemme out'); ?>

    Still not good enough? Use any image:

    <?php jpf_loginout ('', '', '<img src="/images/login.gif" />', '<img src="/images/logout.gif" />'); ?>

    Note: Tested with Wordpress versions up to and including 2.3

    Name: JPF Login/Logout WordPress Plugin [Download]
    Size: 0,51 kBytes
    FileType: .zip-File
    Edited on 03. Mar 2007 - 22:07 h
    Downloads: 1335
    Free for visitors

    Tags:

  • 13 Responses

    WP_Modern_Notepad

    Leave a Comment

    Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.