Tagged: Enfold child, google analytics, header.php
-
AuthorPosts
-
May 3, 2018 at 12:28 pm #950716
Hello Support Team!
I have been trying to find the answer to this because it has bee asked for sure but I could not solve it.
I am using Enfold Child, the header php is not there.
NOte: I have added some lines for a plugin in the functions.php so I hope that anything I do for this issue will not affect that.Q1: How can I add the google analytics code for the Child? Should I do it through FTP for the parent theme (on the header.php) and that will affect the Child?
Q2: I saw in the previous topics that you can add the header.php to your child. How is this done?Thank you very much for your time and for your super support so far (with my previous tickets).
Have a great day.Best
ST
May 4, 2018 at 12:12 pm #951578Hey ST,
The best approach to adding Google Analytics is by adding the code in Enfold Theme Options > Google Services > Google Analytics Tracking Code box.
This works whether you use a child theme or not, and it stays active after updates.
But if you really want to place it in a header.php, then copy header.php to your child theme via FTP & it will be active automatically.
Another option is to include your Google Analytics code in this function and add it to your child theme functions.php:function add_ga_code(){ ?> YOUR Google Analytics CODE GOES HERE <?php } add_action('wp_head', 'add_ga_code');
Best regards,
MikeMay 8, 2018 at 9:47 am #953259Dear Mike
Thank you very much for your reply.
I have added the code.I have an additional question but I don’t know if I should open a new ticket or continue here.
The question is not related to this subject.Thank you.
Best
STMay 8, 2018 at 10:33 am #953284Hi,
Typically we try to keep one question per thread so the threads don’t get so long, but go ahead and ask here :)Best regards,
MikeMay 8, 2018 at 10:39 am #953286I see and I will keep it short.
I am building the store on a submap.
I would like to bypass the home of the submap and go directly to the home of the main.
So when I click on the top left logo (when on the submap) I would like to be guided to the maternal main home.
and not on the home of the submap.
I have achieved this partly with the menu options but the logo is left to change.
Hopefully, this is short.Thank you Mike
May 8, 2018 at 10:40 am #953288I mean bypass store
May 8, 2018 at 12:41 pm #953336Hi,
Sorry, I don’t understand “submap” do you mean “sub-domain” ?
The shop url doesn’t work, please see Private Content area.
Have you tried removing your “Shop” menu item and adding a new “custom link” menu item with the link to the page you want?Best regards,
MikeMay 8, 2018 at 12:58 pm #953346Sorry for this (also for link mistake), it is not a subdomain i thought it is called submap.
Yes I have edited the menu options for the shop.
But still when I click on the logo (top left of the shop) then it takes me back to the store.
So I just want to change the target of the logo.
May 9, 2018 at 2:15 am #953631Hi,
Please try adding this code to the end of your functions.php file in Appearance > Editor:/* change logo link */ function change_logo_link(){ ?> <script type="text/javascript"> (function($){ function change_logo_link() { jQuery("#header_main").find(".logo a").attr("href", "http://www.google.com/"); } change_logo_link(); })(jQuery); </script> <?php } add_action('wp_footer', 'change_logo_link');
Please change the url in the code to where you wish it to point to.
Best regards,
MikeMay 9, 2018 at 7:51 am #953737Dear Mike,
Thank you very much for your help.
I will change the href and add it there, right?Many thanks,
Will come back to close this ticket.
Have a great day.
May 9, 2018 at 12:02 pm #953851Hi,
Yes, just change the Google url to yours.
We will leave this open to hear back from you.Best regards,
MikeMay 9, 2018 at 12:15 pm #953861Dear Mike
It just works.Many thanks
Have a great day.Ticket closed!
Best
STMay 9, 2018 at 12:40 pm #953874Hi,
Glad we were able to help, we will close this now. Thank you for using Enfold.For your information, you can take a look at Enfold documentation here
and the video tutorials here
And if there are features that you wish Enfold had, you can request them and vote the requested ones here
For any other questions or issues, feel free to start new threads under Enfold sub forum and we will gladly try to help you :)Best regards,
Mike -
AuthorPosts
- The topic ‘Enfold child theme add google analytics code’ is closed to new replies.