- This topic has 3 replies, 2 voices, and was last updated 7 years, 9 months ago by Tom.
-
AuthorPosts
-
July 25, 2016 at 3:28 am #212636Andi
Hi Tom,
I want to change the login error message to WordPress so a hacker won’t get an idea if the user name or the password is wrong.
– I learned about child themes: https://codex.wordpress.org/Child_Themes
– I learned I don’t have to add the enqueue code because GP takes care of all that automatically: https://generatepress.com/forums/topic/gp-child-theme/
– I found a code to add in a WP forum:
// Modify WordPress Login Error Messages for Better Security
function new_login_error()
{
return ‘Login fehlgeschlagen: Bitte Username und Password checken.’;
}
add_filter( ‘login_errors’, ‘new_login_error’ );
– I found that the only thing you added to the functons.php is the opening tag ‘<?php’ and a multi line comment (the stuff between ‘/*’ and ‘*/’).Now my two simple questions are:
——————————–
– Do I have to add the php ending tag ‘?>’ to the functions.php or is that also done automatically in GP?
– Why is the styles.css not called style.css as it says in the wordpress.org article about child themes (see link above)? Is that a typo (as I found a message in one forum saying this) or what is the reason this file is named differently than the standard?Thanks,
AndiJuly 25, 2016 at 10:31 am #212732TomLead DeveloperLead DeveloperHi Andi,
The closing PHP tag isn’t required by PHP – I usually don’t add it.
GP detects if you’re using a child theme and adds the core style.css file for you so you don’t have to.
Let me know if you need more info ๐
July 26, 2016 at 1:15 am #212959AndiHi Tom,
thanks for the quick reply!
a) Thanks for letting me that GP adds the style.css on it’s own. But I still don’t get the difference between the included styles.css (with the s in the name, the one that’s in your child zip file) and the automatically created style.css (without the s in the name).
b) Via ftp I created a folder generatepress-child in the folder wp-content/themes and put the two files from your zip-file in there (styles.css and functions.php) after adding my little code from above to the php-file.
Under Appearance / Themes I couldn’t choose the child theme, there is only GPv1.34.
I thought maybe I need to log out and log in again so WordPress scans the themes folder again, but no, still only GP, not the child theme to choose. Also I noticed that the style.css is not automatically created yet.Am I missing a step? I thought as soon as I created the child folder with the two files I could choose this child theme in the WordPress dashboard under Appearance / Themes (at least that’s what they say in the article https://codex.wordpress.org/Child_Themes).
Thanks a lot,
AndiJuly 26, 2016 at 8:54 am #213065TomLead DeveloperLead DeveloperHi Andi,
It might be easier just to install our blank child theme: http://generatepress.com/api/themes/generatepress_child.zip
Let em know ๐
-
AuthorPosts
- You must be logged in to reply to this topic.