Tagged: coding
- This topic has 5 replies, 2 voices, and was last updated 4 years, 9 months ago by
sapana.
-
AuthorPosts
-
February 12, 2019 at 12:36 pm #165712
knudkp
ParticipantRunning 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’ );
*/February 12, 2019 at 11:10 pm #165736sapana
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,
SapanaFebruary 13, 2019 at 12:14 pm #165784knudkp
ParticipantThat’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.
February 14, 2019 at 4:10 am #165835sapana
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,
SapanaFebruary 28, 2019 at 11:39 am #166927knudkp
ParticipantHi 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
KnudMarch 1, 2019 at 1:36 am #166971 -
AuthorPosts
- The topic ‘Changes in functions.php doenst seem to work’ is closed to new replies.