Should you ever edit header.php in Child Themes?

Community Forums Forums General Discussion Should you ever edit header.php in Child Themes?

This topic is: not resolved

This topic contains 4 replies, has 3 voices, and was last updated by  David Chu 9 months, 1 week ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #91296

    georgef
    Participant
    Post count: 8

    I 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?

    #91310

    David Chu
    Participant
    Post count: 1408

    Hi,
    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

    #91316

    dreamdancer
    Participant
    Post count: 13

    I 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.

    #91341

    georgef
    Participant
    Post count: 8

    Thanks 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

    #91370

    David Chu
    Participant
    Post count: 1408

    In 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

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.