WordPress.org

Ready to get started?Download WordPress

Forums

Live Wire
Header, footer editing (8 posts)

  1. Portgaz89
    Member
    Posted 1 year ago #

    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!

  2. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    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.

  3. Portgaz89
    Member
    Posted 1 year ago #

    Thanks a lot, l think l got it together!

    Same for 404.php and all else, right?

  4. paulwpxp
    Font hero
    Posted 1 year ago #

    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.

  5. Portgaz89
    Member
    Posted 1 year ago #

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

  6. Sami Keijonen
    Member
    Theme Author

    Posted 1 year ago #

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

  7. Portgaz89
    Member
    Posted 1 year ago #

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

  8. Sami Keijonen
    Member
    Theme Author

    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic