Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #165712
    knudkp
    Participant

    Running latest WP ver, theme ver at fleksjobbernetvaerket.dk

    Overall question Sholuden’t these below changes to the themes function.php -file work?

    These three changes/addons to my themes function file, denst seem to have effect on my wp-login.php experience. Is the reason the conding, or the theme?

    /** Stop login form shake on erroe
    function my_login_head() {
    remove_action(‘login_head’, ‘wp_shake_js’, 12);
    }
    add_action(‘login_head’, ‘my_login_head’);
    */

    /** Stop login form error msg.
    function no_wordpress_errors(){
    return ‘Something is wrong!’;
    }
    add_filter( ‘login_errors’, ‘no_wordpress_errors’ )
    */

    /** Stop login form and its lost password
    function remove_lostpassword_text ( $text ) {
    if ($text == ‘Lost your password?’){$text = ”;}
    return $text;
    }
    add_filter( ‘gettext’, ‘remove_lostpassword_text’ );
    */

    #165736
    sapana
    Participant

    @knudkp:If you want to make any changes in theme I suggest you to make modifications via child theme. If done so, the changes will not be lost after update. Please put the code in child theme’s functions.php file and Let me know if this works out or not?

    Kind Regards,
    Sapana

    #165784
    knudkp
    Participant

    That’s not the issue.

    The issue is, wether (which i think is quite impossible), if the code will work with my Base Pro -theme. Normally these codes apply to all WordPress functions.php-files, and are the,e-specific.

    #165835
    sapana
    Participant

    @knudkp: In your above code you have miss the (;) and also not remove comment (/**/) due to which your code wasn’t running well. I have corrected and uploaded the code please use this code. Before using code make sure you are working on child theme. I strongly prohibited to make any modification in parent theme. You can use Generate child theme plugin to create child theme.

    /** Stop login form shake on error */
    function my_login_head() {
        remove_action('login_head', 'wp_shake_js', 12);
    }
    add_action('login_head', 'my_login_head');
    
    /** Stop login form error msg. */
    function no_wordpress_errors(){
        return 'Something is wrong!';
    }
    add_filter( 'login_errors', 'no_wordpress_errors' );
    
    /** Stop login form and its lost password */
    function remove_lostpassword_text ( $text ) {
        if ($text == 'Lost your password?'){
            $text = '';
        }
        return $text;
    }
    add_filter( 'gettext', 'remove_lostpassword_text' );

    Let me know if this works out!

    Kind Regards,
    Sapana

    #166927
    knudkp
    Participant

    Hi again

    1. The code for /** Stop login form and its lost password */ doesnt seem to work – however Im not sure

    2, Yes, i know this child-theme is a good idear. Is this really the only way?
    I mean … the only thing I change is content in the functions.php file, and in the custom css box under appereance?

    thanks
    Knud

    #166971
    sapana
    Participant

    @knudkp:I tested the code it was working fine in my end, creating child theme is the best way to make any changes in the theme.
    Go to => Child Theme Folder => functions.php and add the previous provided code.
    Let me know if you still face any problem

    Kind Regards,
    Sapana

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Changes in functions.php doenst seem to work’ is closed to new replies.