Community Forums › Forums › Archived Forums › General Discussion › Should you ever edit header.php in Child Themes?
Tagged: functions, header.php
- This topic has 4 replies, 3 voices, and was last updated 10 years, 11 months ago by
David Chu.
-
AuthorPosts
-
February 19, 2014 at 5:56 pm #91296
georgef
MemberI just hired a developer to make changes to my theme.
He sent me a screen shot of him making changes to the header.php file of my child theme which made my stomach twist..
He said he is a Genesis expert and that is what he does.. I said no way that goes in the functions file.
So before I cancel my contract with this guy, am I overreacting or no?
Would you make changes to the header.php file of your child theme?
February 19, 2014 at 7:35 pm #91310David Chu
ParticipantHi,
That's an interesting question. You both are right, in a way.I am more like you. I will put my goodies in function files - then my custom themes consist of just a handful of files in the child theme. It's lean, mean, and very clean. Hooks and filters, baby! Once I was asked to work on a site that had Genesis, but the dev had used no Genesis features at all, just made a mountain of template files.
BUT - there are those who prefer editing templates. I've noticed that these people often have done WP for awhile, and they are used to doing things this way. Their way can work, and it's easier to start that way if you're experienced in WP, but don't know the Genesis hooks. It's 6 of one, a half-dozen of the other. Every so often you get one of them showing up and whining about how Genesis does things. ๐ To me, someone like this will generally be happier developing with something like _s. After all, why use Genesis if you will ignore all of its features?
So I can't say conclusively that one of you is right without examining the code.
Conversely, I've seen people who started with Genesis, so they know how it works, but they don't know normal WP hooks! ๐
Dave
Dave Chu ยท Custom WordPress Developer – likes collaborating with Designers
February 19, 2014 at 8:11 pm #91316dreamdancer
ParticipantI used to edit the header.php and footer.php to add extra divs to my themes. It works, but I really wanted to do better, I spent hours in tutorials and here on the support board to learn how to add divs in function.php. I still have a couple of themes that I coded the old way and they are running the latest of everything, plus WooCommerce. So it isn't going to do any harm, however, I personally think it is best to do it right and code cleanly.
And I agree, it depends on what code in the header.php is getting changed and if your theme had it changed in the first place. Don't break what is fixed and all that.
February 20, 2014 at 12:18 am #91341georgef
MemberThanks for the input guys.
I think it was just the last straw..
When you hire someone who says he has been working with Genesis for 8 years, charges a premium rate and I had to point out all the little errors happening on his design work, then goes and edits the header.php file just said to me his obviously not the expert he says he is.
It's also Javascript now I don't know if that makes a difference having it in the header.php file?
It was that and a search function
February 20, 2014 at 8:12 am #91370David Chu
ParticipantIn very rare cases, it might be truly necessary to edit header.php. I've never needed to using Genesis. Javascript could be legitimately loaded in header.php, but gee, that can easily be done using wp_enqueue_script, you don't even need any Genesis code for that.
Here's a random thought - PHP coders don't necessarily handle CSS well. They are not the same skill at all. So that may be why you're seeing design weirdness. Again, I can't see details, so I'm speculating.
Good luck!
Dave Chu ยท Custom WordPress Developer – likes collaborating with Designers
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.