WordPress.org

Ready to get started?Download WordPress

Forums

Theme My Login
[resolved] Redirects to blank page if it's the homepage (6 posts)

  1. kuching
    Member
    Posted 1 year ago #

    I'm running WP 3.4.1 and TML 6.2.2

    I've put the TML form inside a custom menu in my theme

    I'm calling the login form with

    theme_my_login( array( 'login_form' => 'login-form.php' ) );

    the menu appears on every page of my website, and with a javascript dropdown the user can log in and out

    the form is running fine, except that if the page where it is fired is the homepage, it will redirect to a blank page, regardless if it's going to throw an error or logging a user

    you can try it yourself here: http://www.nellaterradisandokan.com

    even though it's in Italian, you can click login, then enter any text for the user/password... you'll notice that on the homepage it will return a blank page, while if you do the same on any other page it will return errors correctly

    what it could be?

    ps - do not attempt to register an user at this time, 'cause I'm having some trouble with the registration form too, but that's not handled by TML and the issue has nothing to do with this one

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

  2. kuching
    Member
    Posted 1 year ago #

    also, on a sidenote, I had to edit a plugin theme file to get rid of the $title being displayed in my menu... unfortunately $title in such case is not wrapped by any HTML element which I could style by CSS, ie by hiding it

    the code I've edited is located at line 151 in includes/class-theme-my-login-template.php

    $title = __( 'Log In', 'theme-my-login' );

    I've replaced Log In with a blank string, this retains the title on login page but I can get rid of it in my menu... perhaps I did not do it properly, I didn't know if there was a way to filter that out...

    if it's really hardcoded, perhaps the author might consider to grant users the possibility to edit title names and eventually leave them blank if they want

    [ Please do not bump, that's not permitted here. ]

  3. kuching
    Member
    Posted 1 year ago #

    I found out a solution for the minor issue in my 2nd post, after reading the documentation from the plugin's author page http://www.jfarthing.com/docs/theme-my-login/shortcode - I didn't notice the shortcode section paremeters could apply for the function - the function documentation is a blank page, sorry

    that fixed the title issue

    but the redirection problem still occurs - if user attempts to login from homepage and login data is invalid, then user will get a blank screen; if it's from any page in the website, it will be ok - I wish to fix this

  4. kuching
    Member
    Posted 1 year ago #

    ok I figured the problem out and I hope it's useful for the plugin developer

    in my setup I'm using WordPress as CMS and I'm not using the standard blog function and index.php is empty

    however, if I use TML as a function to display the form somewhere on my page (header) and if there's a login failure (wrong pwd, user name, blank field, etc), the form will redirect to index.php and not to front-page.php which is the wordpress home page and website root

    I had to put an include inside index.php to call front-page.php whichh fixed the issue, because TML was erroneusly redirecting to index.php even if I was executing the form from front-page.php

  5. JOakland
    Member
    Posted 1 year ago #

    Would you mind posting your code for that, Substrato? I have a client site with the same problem and I'm hard up for a solution.

    Thanks a ton!

  6. kuching
    Member
    Posted 1 year ago #

    sure

    suppose you want to display the TML login form somewhere in your template (in a widget, in the header, in the footer, anywhere), you just use the function:

    theme_my_login( array( 'show_title' => false, 'show_reg_link' => false, 'instance' => 1, 'login_template' => 'login-form.php' ) );

    show_title allowed me to turn off the title display (I didn't want it); also I didn't want to display the registration link (which are managed by another plugin in my case; then you can specify a template

    to avoid the redirect problem I had

    I entered in my index.php (which was otherwise empty)

    include( 'front-page.php' );

    I had to do this because I'm not using the WP blog function (where index.php would be the blog index) and my home page template is represented by front-page.php;

    If you have other redirect problems, try to look into your redirect settings in the TML control panel; also double check your htaccess and permalink structure

    hope this will help you

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic