• Hi everyone,

    I need to modify something that is usually in the header.php file. However, if I do so in the main theme file, chances are I will loose the modification whenever the theme is updated, hence the reason why I use the Customizr Child theme.

    Anyone know how to make modifications in the header file of Customizr’s Child theme?

    Thanks in advance to all who reply.

    Marc

Viewing 9 replies - 16 through 24 (of 24 total)
  • Thread Starter mdugre

    (@mdugre)

    As I’m sure you know Andrew, considering it’s free, the Customizr theme is actually pretty good.

    Themes and Co. is constantly upgrading it too. I wouldn’t be surprised if the author, Nicolas Guillaume, would add some header.php modification capabilities in the theme at some point.

    Heck, there is an already an advanced option capability built-in allowing you to input custom CSS code. My next step is actually to see if I can do what I want using that feature

    Thread Starter mdugre

    (@mdugre)

    Quetas_admin when you say the following you are partially correct (I think)

    According to the codex you can do it with any theme.

    If you want to change more than just the stylesheet, your child theme can override any file in the parent theme: simply include a file of the same name in the child theme directory, and it will override the equivalent file in the parent theme directory when your site loads. For instance, if you want to change the PHP code for the site header, you can include a header.php in your child theme’s directory, and that file will be used instead of the parent theme’s header.php.

    The problem I see in doing this is that the parent header.php file becomes useless. The child themes’ version takes over.

    This basically means that every time there’s an update, unless you copy the header.php file in the child themes’ directory and add back your modification to it, you’re S.O.L.

    Which brings us back to square one

    David_G

    (@questas_admin)

    I read that too. But from what I have been told by experts here is that the site reads the core files first then applies the changes that are in the child theme files. I may have that backwards, but for instance, there is a stylesheet and functions.php files in the core, the changes you add to those same files in the child does not cancel out anything in the core files that you have not selected for change..

    Thread Starter mdugre

    (@mdugre)

    Good point

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    @questas_admin, but your for instance examples are the only files where things work like that. The parent stylesheets are enqueued via the theme’s functions.php file, and a functions.php file does not behave like a template file in a Child Theme.

    David_G

    (@questas_admin)

    I know I did it once a while back and it worked. It is worth trying, it wont hurt the core files. If it doesn’t work then delete the header.php file from the child.

    David_G

    (@questas_admin)

    That is the true beauty of WP and child themes. You can try things out. Sometimes it doesn’t work, but you are not changing the core files, so you are not hurting your wp overall. Even a bad php snippet can give you the white screen of death, but with FTP you can fix what you did wrong and your back up and running. The point is DONT CHANGE THE CORE FILES unless you really know what you are doing.

    Do you agree with that?

    David_G

    (@questas_admin)

    Only just seen this so let me add my input.

    There is nothing to stop you copying your core header.php into the same folder location in your Child Theme and changing it. But as you’ve observed, the next update will overwrite the core file and you’ll miss out on latest changes. I have a site using twentytwelve where I have heavily customized the header, footer and some templates but that Theme is pretty static so it doesn’t change very often.

    Czr is different because it is under constant change so this is not the best strategy.

    Which is why Czr has such a comprehensive Hooks API. These get placed into th CT functions.php and unless hook names change, they remain active throughout the life of Czr.

Viewing 9 replies - 16 through 24 (of 24 total)
  • The topic ‘Customizr child theme’ is closed to new replies.