Home › Forums › Community Support Forum › WordPress Plugins › Orbisius Child Theme Creator › CSS and php files the same
Tagged: child theme files, parent theme files
- This topic has 5 replies, 2 voices, and was last updated 8 years, 1 month ago by Slavi Marinov.
-
AuthorPosts
-
October 1, 2016 at 9:29 am #3463martinriceParticipant
In the dashboard, for Theme #1 on the left which is my child theme, when I look at my functions.php file, the contents are the same as my css.style file. That’s also true for footer.php and header.php files.
I’m afraid that if I erase the content, say, of functions.php in my child theme file to put in .php snippets, then that will change the child theme css.style file.
Is that so?
Thank you for your help.
October 1, 2016 at 4:34 pm #3464Slavi MarinovKeymasterHi Martin,
Child theme’s functions.php should be empty.
The plugin had an option to copy the file from the parent theme and this almost guaranteed site crash.
People were trying to be lucky and took the chance and indeed their site crashed because php doesn’t allow functions with the same name to exist.
You have to check if the parent theme’s function.php has function_exists() calls to the functions you want to change.You should be editing style.css from within your child theme’s folder.
The header & footers files are exact copies of the files from the parent theme.
You can edit those files.Slavi
October 1, 2016 at 7:30 pm #3465martinriceParticipantHi, Slavi:
Thanks for the response. When I set up the plugin I didn’t realize that I shouldn’t have created the php file. So I have one more question: if I want to make changes in the functions.php file, where should I do it?
Thanks,
MartinOctober 3, 2016 at 11:42 am #3466Slavi MarinovKeymasterit should be within the child theme’s folder.
The functions.php file should start with the php opening tag. You don’t have to close it.
October 3, 2016 at 11:45 am #3467martinriceParticipantThank you for the answer, Slavi. So if that’s where it is, then to make changes I guess I have to modify the file and then ftp it, is that right?
Thanks again,
MartinOctober 3, 2016 at 11:53 am #3468Slavi MarinovKeymasterHi Martin,
You can use an FTP program if you’re comfortable with it, however, thre’s an easier way.
Please you go to WP Admin > Appearance > Orbisius Theme Editor and you should see the double editor. With this editor you can create a new files such as functions.php file from within WordPress.
This editor is also useful when you want to copy some piece of content from the parent theme to the child theme.For php related files make sure you click on check syntax button to make sure the code is correct otherwise you WILL crash your site.
When adding functions to functions.php don’t just copy and paste functions from the parent functions.php because that WILL 100% positively crash your site.
You want to have a block like this
if ( ! function_exists('some_function') ) { function some_function() { } }
Slavi
-
AuthorPosts
- You must be logged in to reply to this topic.