Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1150723
    janequade
    Participant

    I followed instructions in thread post #247434
    Added code then GA code as instructed.
    Now I cannot log into my website or make any changes.
    Getting following error

    The cbigmd.com page won’t load
    can’t log into cbigmd.com/wp-admin either
    ERROR
    cbigmd.com is currently unable to handle this request.

    credentials in next post.

    #1150724
    janequade
    Participant
    This reply has been marked as private.
    #1150829
    Rad
    Moderator

    Hi there,

    Thanks for writing in.

    It should be okay now, you shouldn’t add your embed code directly to functions.php without a hook. And embed code is not HTML and not PHP.

    I removed this from your parent theme’s functions.php

    <script>
    
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
    
      ga('create', 'UA-75246404-1', 'auto');
    
      ga('send', 'pageview');
    
    

    Instead, please add this code to your child theme’s functions.php

    add_action('wp_footer', 'footer_embed_code' );
    
    function footer_embed_code () { ?>
    
    <script>
    
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
    
      ga('create', 'UA-75246404-1', 'auto');
    
      ga('send', 'pageview');
    
    </script>
    
    <?php }

    As you’ll notice, there is ?> <?php wrapping your embed code. That indicates that within it are HTML content.

    ?> HTML CONTENT HERE <?php

    Hope this helps.

    #1151144
    janequade
    Participant

    Thanks so much for helping me out here.
    Much appreciated.

    #1151145
    Rue Nel
    Moderator

    You’re welcome! We’re happy to help you out.
    If you need anything else we can help you with, don’t hesitate to open another thread.

  • <script> jQuery(function($){ $("#no-reply-1150723 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>