0

I am using Theme My Login and have noticed that, even though I am customising my own login-form.php template and simply including the appropriate form on a blank page with theme_my_login();, the text Log In is always appearing and is not even in a selectable DOM element:

Log In
<div class="login" id="theme-my-login1">
  <form name="loginform" id="loginform1" action="http://domain/login/" method="post" target="_blank">
  ...

I'm wondering if there is any way to remove this 'Log In' text? I'm not sure where it is coming from.

I've also tried hooking login_headertitle as in this Codex Article.

  • That looks to be the right file, best I can tell. Are you sure your custom login-form.php is loaded? Maybe put hello world in it just to be sure? – Pat Jan 14 '14 at 1:55
  • @Pat Yes the custom code is loaded, I've modified it a fair bit and the changes are appearing. I'm confused because the text "Log In" appears nowhere in the Theme My Login block nor the page template. I'm thinking I can catch the output to an output buffer and strip the text "Log In", but that doesn't seem ideal. – waffl Jan 14 '14 at 8:59
  • I have a local dev site and a production site. At present my TML works perfectly on my local site. On my production server I get the extra "Log In" text and the id for the form has changed from loginform to loginform1, which is the same as yours. – strattonn May 27 '15 at 0:28
4

Use shortcode:

[theme-my-login show_title=0]

or function:

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

I would just use CSS to hide it:

#theme-my-login1 #header-element {
 display:none;
}

Add to the login page by using a function / filter e.g.

function custom_login_css() {
 echo '<style type="text/css">#theme-my-login1 #header-element {
 display:none;}</style>';
}
add_action('login_head', 'custom_login_css');
1

Welp the filter provided in the Wordpress forums won't seem to work either. I'm on multi-site.

// Change the Theme My Login Login Template Header

function tml_title_filter( $title, $action ) { if ( 'login' == $action ) return 'Login / Register'; return $title; } add_filter( 'tml_title', 'tml_title_filter', 10, 2 );

Ok, found the relevant doc here:

http://www.jfarthing.com/development/theme-my-login/changing-page-titles/

Watch out for the error in the code:

$user = wp_get_current_user;

should be:

$user = wp_get_current_user();

  • The docs above provide a function that does the trick. – Ken Prince Jul 3 '14 at 16:30
0

I just had this problem. This is how I fixed it...

Pass $args = array( 'show_title' => false ); as a parameter.

So yo would have something like this:

// arguments for Theme My Login

$args = array( 'show_title' => false );

Theme_My_Login( $args );

I was showing the login form in a modal so I used this to add the login form without the title.

0

To remove the title completely from all the forms:

function tml_title( $title, $action ) {
    $title = '';
    return $title;
}
add_filter( 'tml_title', 'tml_title', 11, 2 );
  • It would also remove "forget password link text & register link text. Please take care about it – por May 15 '17 at 7:24
-1

For those looking for this in the future... In the includes folder, in the class-theme-my-login-template.php and go to

public function get_title()

Then in the default case in the switch statement, replace $title = __( 'Log In' ); with $title = __( '' );.

  • Are you really suggesting to modify core files? – kaiser May 1 '14 at 22:18
  • 2
    -1 for this answer. You should NEVER change core/theme/plugin templates. It is extremely bad practice. This is what child themes are for – Pieter Goosen May 2 '14 at 5:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.