Line of code crashed entire site

Community Forums Forums General Discussion Line of code crashed entire site

This topic is: resolved

This topic contains 5 replies, has 4 voices, and was last updated by  Anita 1 year, 7 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #13230

    Grimwolf
    Participant
    Post count: 45

    I was working on trying to add Google Analytics to my site. I followed some instructions I found here; http://www.wpbeginner.com/beginners-guide/how-to-install-google-analytics-in-wordpress/
    I was following the part where it says to add this code;

    (won’t let me paste the code for some reason, it’s found in the section titled Functions.php Method on that page)

    To Functions.php.
    To accomplish this I went into Appearance > Editor > Theme Functions, and posted the code into the very end, immediately after;

    genesis_register_sidebar( array(
    ‘id’ => ‘custom-footer’,
    ‘name’ => __( ‘Custom Footer’, ‘minimum’ ),
    ‘description’ => __( ‘This is the custom footer section.’, ‘minimum’ ),
    ) );

    I then went into my Google Analytics account and posted the code that gave me over the “// Paste your Google Analytics code from Step 6 here” line.
    I hit Update File, it starts loading, and boom; the whole site crashes. Nothing will load.
    I was able to get back into that section by hitting Back, and I removed the code I had added and hit Update File again, but it is still crashed. I assume it wasn’t able to actually TRY updating the file again since the whole site is already crashed, including the Dashboard.
    Does anyone know how I can fix this, and what the proper way would be to add Google Analytics code to the site?

    • This topic was modified 1 year, 7 months ago by  Grimwolf.
    • This topic was modified 1 year, 7 months ago by  Grimwolf.
    • This topic was modified 1 year, 7 months ago by  Grimwolf.
    • This topic was modified 1 year, 7 months ago by  Grimwolf.
    • This topic was modified 1 year, 7 months ago by  Grimwolf.
    • This topic was modified 1 year, 7 months ago by  Grimwolf.
    • This topic was modified 1 year, 7 months ago by  Grimwolf.
    • This topic was modified 1 year, 7 months ago by  Grimwolf.
    • This topic was modified 1 year, 7 months ago by  Grimwolf.
    • This topic was modified 1 year, 7 months ago by  Grimwolf.
    #13241

    buddy_boy8403
    Participant
    Post count: 132

    You don’t need to modify the functions.php file to include google analytics code.  Instead, go to wp-admin > Genesis > Scroll to the very bottom and paste your analytics code into the second box from the bottom to have it output in the wp_head() section.

    That’s all – your analytics will be set up.

    #13276

    Grimwolf
    Participant
    Post count: 45

    Thanks.
    With that out of the way, does anyone know then how to un-crash my site? The Dashboard is crashed too, so I can’t just undo the code change I made. I’m curious how something that simple could have even caused such a massive issue. It’s not like I messed with any of the existing code.

    #13282

    Susan
    Moderator
    Post count: 8700

    Read Nick’s guide to site recovery tips and tricks here:

    http://designsbynickthegeek.com/tutorials/site-recovery-tips-and-tricks


    Susan @ Graphically Designing I’d love to customize your website! I tweet!
    I’ve taken up the challenge! – help me answer some of the unanswered posts

    #13338

    Grimwolf
    Participant
    Post count: 45

    Awesome, thank you. Following that guide I was able to open the file in FTP and remove the changes I made there, upload it to the site and it was fixed.

    #13339

    Anita
    Participant
    Post count: 7493

    If it was your functions.php file that you were modifying, just copy the functions.php file from your original zip file over to the theme file via FTP and the site should come back.


    When asking for help, please provide a link or screen shot showing your problem!
    Let me help you customize your theme, responsive header, Buddypress, Agentpress or technical issue!
    Visit me here: Cre8tiveDiva.com | Tweet Me!

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Line of code crashed entire site’ is closed to new replies.