Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact

Add login/password field to header (instead of side widget)

Simple Membership Plugin › Forums › Simple Membership Plugin › Add login/password field to header (instead of side widget)

Tagged: header, login form

  • This topic has 5 replies, 3 voices, and was last updated 9 years, 5 months ago by sezg.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • November 30, 2016 at 6:38 pm #9039
    sezg
    Participant

    Hi, Thanks for the fantastic product!

    1) Is it possible to add the login form to the header? I want the actual username/password inputs instead of making the user go to a separate login page. I am not using a side widget and would like it on all pages.

    2) If user is already logged in, I’d like to display the username and a logout link. I think the code is something like:

    <?php
    if ( SwpmMemberUtils::is_member_logged_in() ) {
    $mp_username = SwpmMemberUtils::get_logged_in_members_user_name();
    echo(‘<div class=”user_menu user_menu_registered”>’ . $mp_username . ‘</div> Logout‘);
    }
    else {
    echo ‘LOGIN FORM GOES HERE’;
    }
    ?>

    Can you please help me? Thanks again!

    November 30, 2016 at 11:08 pm #9041
    mbrsolution
    Moderator

    Hi, have you checked the following URL Miscellaneous Tweaks?

    December 1, 2016 at 3:57 pm #9048
    sezg
    Participant

    Thanks, yes. That’s how I was able to write the php to determine if the user is logged in or not. However, I am still unable to find documentation of how to print the login form itself. This part:
    else {
    echo ‘LOGIN FORM GOES HERE’;
    }

    In the widget, it’s:
    [swpm_login_form]

    This does not work in header.php. Any ideas? Thanks for the help.

    December 1, 2016 at 10:54 pm #9053
    mbrsolution
    Moderator

    Hi, the plugin developers will investigate further your issue.

    Thank you

    December 4, 2016 at 7:50 am #9085
    admin
    Keymaster

    You can use the following code to add the login form in any of your theme’s PHP file:

    
    <?php
    echo do_shortcode('[swpm_login_form]');
    ?>
    

    In your case, you will add it to the header.php

    December 5, 2016 at 3:09 pm #9099
    sezg
    Participant

    That’s exactly what I needed! Works perfectly. Thanks for the great product and support!

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Log In

Please read this message before using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Documentation

  • Documentation Index Page

Copyright © 2026 | Simple Membership Plugin | Privacy Policy