Title: add code to the child theme functions.php file
Last modified: August 22, 2016

---

# add code to the child theme functions.php file

 *  Resolved [leblanc1](https://wordpress.org/support/users/leblanc1/)
 * (@leblanc1)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/add-code-to-the-child-theme-functionsphp-file/)
 * Hello , I want to add this function to the functions.php file of my theme son,
   I have to
    modify the code ?
 * disqus_config function () {
    this.callbacks.onNewComment = [function () {_ga.
   push([‘_trackevent’,’formulario’,’enviado’,<? php the_title();?>’]);/> }

Viewing 15 replies - 1 through 15 (of 15 total)

 *  [ibogo](https://wordpress.org/support/users/ibogo/)
 * (@ibogo)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/add-code-to-the-child-theme-functionsphp-file/#post-5697034)
 * To add this code to functions.php go to:
 * Appearance->Editor
 * Click Theme Functions”functions.php” on right-hand side.
 * Scroll to after the part that says “This is where Customizr begins” to blank 
   space and paste this code.
 * If you get a white screen download WinSCP and contact your hosting provider and
   they will help you get back onto your site.
 *  Theme Author [presscustomizr](https://wordpress.org/support/users/nikeo/)
 * (@nikeo)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/add-code-to-the-child-theme-functionsphp-file/#post-5697084)
 * Hi [@leblanc1](https://wordpress.org/support/users/leblanc1/), this javascript
   code will generate error if you paste it like as it is currently written in functions.
   php.
    You’ll want to wrap it into php tags and hook it in wp_head or wp_footer
   for example. I hope this helps!
 *  Thread Starter [leblanc1](https://wordpress.org/support/users/leblanc1/)
 * (@leblanc1)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/add-code-to-the-child-theme-functionsphp-file/#post-5697161)
 * nikeo hi , thanks for answering . I need your help, if I need to wrap this code
   in wp_footer to add it to my theme functions file customizr son , would I like
   would you say to add correctly? . What I want to do is measure the comments of
   my blog with google analytics and I installed on the blog for comments Disqus.
   
   How does this code would be nice to add to the file are listed functions.ph my
   son customiz topic ?. Thanks in advance
 * function disqus_config( ) {
    this.callbacks.onNewComment= {function( ) else{ 
   _gash.push([‘_trackevent’, ‘comment’, ‘send’, ‘<php the title( )?>’])}; }
 *  [Rocco Aliberti](https://wordpress.org/support/users/d4z_c0nf/)
 * (@d4z_c0nf)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/add-code-to-the-child-theme-functionsphp-file/#post-5697163)
 * leblanc1 that is a javascript code. Where did you take that code? I don’t think
   is correct…
 *  Thread Starter [leblanc1](https://wordpress.org/support/users/leblanc1/)
 * (@leblanc1)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/add-code-to-the-child-theme-functionsphp-file/#post-5697170)
 * hello d4z_c0nf. I’m not a programmer, and I want advice from a programmer to 
   help me, I have taken an example of disqus which is a plugin for comments. I 
   want to measure my blog’s comments with events in google analytics and I have
   to install a code to add the function to the functions.php file of my theme son
   customizr. I need help with code
 *  [Rocco Aliberti](https://wordpress.org/support/users/d4z_c0nf/)
 * (@d4z_c0nf)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/add-code-to-the-child-theme-functionsphp-file/#post-5697172)
 * leblanc1 I would like to help you, I can tell you how to put javascript code 
   in wp_footer, in wp_header, but are you sure that code will work? For example
   this `<php the title( )?>` is wrong and should be: `<?php the_title(); ?>` also
   a function which starts with `else` doesn’t convince me, but maybe I’m wrong 
   on this point..
    Basically this is the code to add javascript in wp_footer
 *     ```
       add_action('wp_footer','disqus_track', 10);
       function disqus_track() {
        ?>
        <script type="text/javascript">
       /* script here */
          function disqus_config() {
       this.callbacks.onNewComment = [ function() { _gash.push(['_trackevent', 'comment', 'send', '<?php the_title(); ?>'])} ];
       }
        </script>
        <?php
       }
       ```
   
 * While I was writing this I’ve found [this](https://help.disqus.com/customer/portal/articles/466258-capturing-disqus-commenting-activity-via-callbacks)
 * And the javascript it uses is the correct one… so I changed it in your code.
 * Hope this helps
 *  Thread Starter [leblanc1](https://wordpress.org/support/users/leblanc1/)
 * (@leblanc1)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/add-code-to-the-child-theme-functionsphp-file/#post-5697174)
 * Thank you so much for helping me d4z_c0nf, ¿/ * script here * / I leave alone?.
   Now , I add the code you have given me , once inserted , I have to wait to see
   the results in google analytics , a million thanks d4z_c0nf
 *  [Rocco Aliberti](https://wordpress.org/support/users/d4z_c0nf/)
 * (@d4z_c0nf)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/add-code-to-the-child-theme-functionsphp-file/#post-5697175)
 * Hopefully it will work 😀
    And yes you can remove that /* script here */ sorry
   for that useless comment 😀
 *  Thread Starter [leblanc1](https://wordpress.org/support/users/leblanc1/)
 * (@leblanc1)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/add-code-to-the-child-theme-functionsphp-file/#post-5697176)
 * as soon as you notice, and many thanks for helping me work with code. regards
 *  [Rocco Aliberti](https://wordpress.org/support/users/d4z_c0nf/)
 * (@d4z_c0nf)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/add-code-to-the-child-theme-functionsphp-file/#post-5697178)
 * Np,
    if it will work will you come back to mark this topic as resolved? 😀
 *  Thread Starter [leblanc1](https://wordpress.org/support/users/leblanc1/)
 * (@leblanc1)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/add-code-to-the-child-theme-functionsphp-file/#post-5697179)
 * If apologize , I forgot to tick the issue resolved , now the frame. and a million
   thanks for helping
 *  [Rocco Aliberti](https://wordpress.org/support/users/d4z_c0nf/)
 * (@d4z_c0nf)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/add-code-to-the-child-theme-functionsphp-file/#post-5697180)
 * You’re welcome 😉
 *  Thread Starter [leblanc1](https://wordpress.org/support/users/leblanc1/)
 * (@leblanc1)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/add-code-to-the-child-theme-functionsphp-file/#post-5697332)
 * hi d4, does not work, google analytics does not measure me disqus comments
 *  [Rocco Aliberti](https://wordpress.org/support/users/d4z_c0nf/)
 * (@d4z_c0nf)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/add-code-to-the-child-theme-functionsphp-file/#post-5697333)
 * Hi leblanc1,
    I’m sorry. The thing is that’s the way to add javascript in the
   footer in wordpress. Now why it doesn’t work? Probably ’cause that script isn’t
   correct for your needs, dunno..
 *  Thread Starter [leblanc1](https://wordpress.org/support/users/leblanc1/)
 * (@leblanc1)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/add-code-to-the-child-theme-functionsphp-file/#post-5697334)
 * hello 4z,I think the problem is trackEvent , category , tag action and event ,
   I think not accepted as the_title label , what you give as a category, share 
   and tag ?

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘add code to the child theme functions.php file’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/customizr/4.4.24/screenshot.png)
 * Customizr
 * [Support Threads](https://wordpress.org/support/theme/customizr/)
 * [Active Topics](https://wordpress.org/support/theme/customizr/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/customizr/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/customizr/reviews/)

 * 15 replies
 * 4 participants
 * Last reply from: [leblanc1](https://wordpress.org/support/users/leblanc1/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/add-code-to-the-child-theme-functionsphp-file/#post-5697334)
 * Status: resolved