Tagged: child theme, google tag manager, header.php
-
AuthorPosts
-
February 6, 2015 at 9:23 am #391875
Hi there,
I’ve setup a child theme for enfold which is working fine.
I need to add Google Tag manager to the site and the recommended method is to add the code into header.php
My standard child theme setup doesn’t have a header.php
My question are:
1.
Can I simply create a header.php file in the child theme folder?2.
If so, what standard code do I need to place in the file?Thanks in advance.
Kevin
February 6, 2015 at 11:33 am #391926Hi kashcroft!
You can simply copy header.php from your Enfold folder into your child theme folder. I’m not 100% sure about where to add the Google Tag Manager code though but I think it goes into the head tag.
Regards,
RikardNovember 2, 2015 at 4:15 pm #528572Hi Rikard,
I have done your suggestion – simply copy header.php from your Enfold folder into your child theme folder – but when I check the source code it is still using the parent theme header instead of child theme.Any ideas? Thanks.
November 3, 2015 at 3:49 am #528956Hey!
Did you activate the child theme? Please post the login details here so that we can check it.
Cheers!
IsmaelNovember 9, 2015 at 9:53 am #532434Hi Ismael,
Yes the child theme is activated. I have tried disabling plugins and cache plugins but no change.Strangely the child theme works fine for css and function.php files, but not for any theme layout files such as header.php.
I have added the login info below. It would be great if you could have a look. Thanks.
November 10, 2015 at 4:57 am #533025Hey!
It is using the child theme’s header.php file. I modified the code a bit to test it:
<?php echo "Test"; do_action('ava_after_main_container'); ?>You can see the “Test” text at the very top of the site. Original code is:
<?php do_action('ava_after_main_container'); ?>Cheers!
IsmaelNovember 10, 2015 at 9:20 am #533103Thank you! Not sure why it didn’t seem to work for me but it is indeed working now – cheers.
-
AuthorPosts
- The topic ‘header.php in child theme’ is closed to new replies.
