• Hello everyone,

    I want to link my g+ page with my website, put google analytics etc. all these need to add some code in different sections, like header, footer or whatever.

    I would like to ask you how do we do this in child theme? We go to functions.php, or style.css, transfer the whole header code from parent theme and then just add our code customizations, or there is a different way?

    Do we have to erase any code that takes the style.css from parent theme?

    Thanks in advance!

Viewing 7 replies - 1 through 7 (of 7 total)
  • For header and footer changes, make a copy of the header.php and footer.php file from the parent theme and put the copies in the child theme folder – then make the changes you want in the child theme versions. WP will then use those versions.

    Functions is more complicated – don’t copy that to your child theme or it will crash the site. If you need to make changes to the functions file, post back with a specific question as to what you are trying to do.

    Thread Starter Portgaz89

    (@portgaz89)

    Thanks a lot, l think l got it together!

    Same for 404.php and all else, right?

    Live Wire is built on Hybrid Theme Framework.

    There are hooks in several places available for what you need done. To make changes or override what parent theme does, in most situations, you won’t need to duplicate the template in child theme, you work with hooks instead.

    Thread Starter Portgaz89

    (@portgaz89)

    Thanks, but l am not really into development, css and all this stuff, so l think duplicating them is easier for me…

    Theme Author Sami Keijonen

    (@samikeijonen)

    For google analytics code it’s better to use plugin. There are several plugins for that in wordpress.org.

    Thread Starter Portgaz89

    (@portgaz89)

    Thanks for your replies guys. I checked one plugin, but I would prefer to do it the old-school way, by pasting the code.

    If this cannot happen on live wire, I will use a plugin.

    I pasted the code on head between the <head> and </head>, but google doesn’t recognize it…

    Theme Author Sami Keijonen

    (@samikeijonen)

    It’s better to use plugin for google analytics code because you’re not gonna use Live Wire theme forever. And any custom code you add in a theme files is not gonna work after change the theme. Therefore it’s better to use plugin for this kind of stuff.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Header, footer editing’ is closed to new replies.