WordPress.org

Ready to get started?Download WordPress

Forums

Theme My Login
[resolved] Using template tag (6 posts)

  1. Matteo Legittimo
    Member
    Posted 1 year ago #

    Hi Jeff,
    how can i use template tag to show login form, register form and lost password in my template file?
    Im using this:

    <?php theme_my_login( array( 'register_form' => 'register-form.php' , 'show_title' => 0) ); ?>

    but it's showing just the login form.
    register-form.php it's in my theme folder

    Thanks a lot

    http://wordpress.org/extend/plugins/theme-my-login/

  2. Matteo Legittimo
    Member
    Posted 1 year ago #

    Hey Jess,
    i found the solution in the forum!
    Im doing like this:

    <?php theme_my_login( array( 'default_action' => 'login', 'show_title' => 0 ) ); ?>

    <?php theme_my_login( array( 'default_action' => 'register', 'show_title' => 0 ) ); ?>

    <?php theme_my_login( array( 'default_action' => 'lostpassword', 'show_title' => 0 ) ); ?>

    This is in the index.php, because just user logged can see the site.
    The problem is that in the register module or in the lost password module , if the field are wrong, it redirect to login/?action=lostpassword showing the login module.
    I tried to redirect to the home page from General -> Permalinks, but this solution not working, it's not showing the error message, but still the login form.
    How can i do?
    Thanks a lot

  3. Jeff Farthing
    Member
    Plugin Author

    Posted 1 year ago #

    You need to change the form ACTION attribute in your form templates.

  4. Matteo Legittimo
    Member
    Posted 1 year ago #

    Hi Jeff,
    - i copied login-form.php, register-form.php and lostpassword-form.php in my theme folder

    - in my home.php (it's a static page that im using like index) i have the code that i told u before

    - In TML -> General -> Permalink i setup di urls with just / to redirect to my home page

    - The Action attributes are:
    action="<?php $template->the_action_url( 'login' ); ?>"
    action="<?php $template->the_action_url( 'register' ); ?>"
    action="<?php $template->the_action_url( 'lostpassword' ); ?>"

    But i dont konw i should change!
    Thanks a lot if u can help me! I really need!

    Matt

  5. Jeff Farthing
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, and the_action_url usually points to the actual Login page. Instead, change the action to whatever the URL is of the page you're using.

  6. Matteo Legittimo
    Member
    Posted 1 year ago #

    Hi Jeff,
    no need to change the action URL in my template file, because this:

    $template->the_action_url( 'login' );
    $template->the_action_url( 'register' );
    $template->the_action_url( 'lostpassword' );

    thake the value from -> General -> Permalink

    I just changed the permalink like this:
    /?action=login&instance=1
    /?action= register&instance=1
    /?action= lostpassword&instance=1

    Like this, point to myhome page all 3 form. Im gonna hide/show with css and jQuery

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.