Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #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

    #951578

    Hey 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,
    Mike

    #953259

    Dear 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
    ST

    #953284

    Hi,
    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,
    Mike

    #953286

    I 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

    #953288

    I mean bypass store

    #953336

    Hi,
    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,
    Mike

    #953346

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

    #953631

    Hi,
    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,
    Mike

    #953737

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

    #953851

    Hi,
    Yes, just change the Google url to yours.
    We will leave this open to hear back from you.

    Best regards,
    Mike

    #953861

    Dear Mike
    It just works.

    Many thanks
    Have a great day.

    Ticket closed!

    Best
    ST

    #953874

    Hi,
    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

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Enfold child theme add google analytics code’ is closed to new replies.