WordPress.org

Ready to get started?Download WordPress

Forums

Theme My Login
[resolved] Log In - Menu Bar (12 posts)

  1. gh0zt
    Member
    Posted 3 years ago #

    When I add the page called "Login" generated by the plugin to my menu it shows "Log In" when not logged in and "Log Out" when logged in.

    This is cool but I would like it to say "Login / Register" when not logged in so it looks more attractive to visitors that aren't currently members.

    Is there a way to do this? It doesn't seem to be possible in the way normal menu items can be renamed.

    Thanks!

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

  2. Jeff Farthing
    Member
    Plugin Author

    Posted 3 years ago #

    Create a a file named theme-my-login-custom.php in your wp-content/plugins directory. Add the following to it:

    <?php function tml_title_filter( $title, $action ) {
    	if ( 'login' == $action )
    		return 'Login / Register';
    	return $title;
    }
    add_filter( 'tml_title', 'tml_title_filter', 10, 2 ); ?>
  3. gh0zt
    Member
    Posted 3 years ago #

    Thanks but this only changes the widget which is not what I wanted.

    I want the Login / Register text to appear in the normal wordpress menu.

  4. Jeff Farthing
    Member
    Plugin Author

    Posted 3 years ago #

    I assume you're using the wp_nav_menu() function with a custom menu?

    Try this:

    [Code moderated as per the Forum Rules. Please use the pastebin]

  5. gh0zt
    Member
    Posted 3 years ago #

    Hi Jeff, yes I just added the "Login" page that was automatically generated to the main custom menu.

    I can't see the last code you pasted, the forum removed it.

  6. Jeff Farthing
    Member
    Plugin Author

    Posted 3 years ago #

  7. gh0zt
    Member
    Posted 3 years ago #

    Didn't work for me but I found the text in class-theme-my-login.php and edited it directly which solved the problem.

    Thanks for your help Jeff, much appreciated. I love this plugin.

  8. logesh
    Member
    Posted 2 years ago #

    Hi gh0zt my need is same as yours ..i wish to have Login / Register instead of usual Log In and Log Out ...Can you tell me how you achieved this.

  9. Rene Michaels
    Member
    Posted 2 years ago #

    All, to change the title "Log In" to something else, edit line #467 of the file "theme-my-login/includes/class-theme-my-login.php"

    Change:

    $title = is_user_logged_in() ? __( 'Log Out', 'theme-my-login' ) : __( 'Log In', 'theme-my-login' );

    to:

    $title = is_user_logged_in() ? __( 'Log Out', 'theme-my-login' ) : __( 'Member Login', 'theme-my-login' );

    Great work on the plugin Jeff! It is a must for every WP installation!!!

  10. Mike_Gallagher
    Member
    Posted 2 years ago #

    My Log In/ Log Out button takes the user to the Profile page and doesn't Log them out. I am using the "Members Only" plug-in which I thought might be causing the problem, but deactivating that Plug-in gave the same results. Any thoughts?

  11. mote
    Member
    Posted 2 years ago #

    hi guys,

    as ghozt's question has been resolved i thought id add another one which is related somewhat,

    im trying to add / or replace that logout button to "dashboard" instead
    so when im logged in i can enter the dashboard from the site aswell as the redirect after login...

    i have no reason to sign out of my own page so thought that changing the logout button would save some time instead of adding a dashboard button?

    alternatively is there a way to add a dynamic menu in wordpress the dashboard menu link is displayed only when logged in?

    thanks in advance guys
    andy.

  12. superpotion
    Member
    Posted 2 years ago #

    I'd also like to change my menu button to something like "Secure Login / Register", but editing the plugin code directly as suggested by ghOzt would break the mod when the plugin is updated. I suggest making this a variable, say "login message", which can be accessed from the settings.

    Great plugin Jeff

    Thanx, Denis.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic