WordPress.org

Ready to get started?Download WordPress

Forums

Editing functions.php file has caused my site to crash (8 posts)

  1. DESIGNbyDOUGLAS
    Member
    Posted 1 year ago #

    Whilst trying to install a megamenu widget i have somehow crashed my website. I followed the instructions detailed below and then removed all code after the crash via my control panel file manager.

    Here's the code I added (and then removed)

    Go into your Wp-Admin
    Go to Appearances >> Editor
    Find the file functions.php
    Before the closing ?>, add the following lines of code:
    if ( function_exists('register_sidebar') ){
    register_sidebar(array(
    'name' => 'my_mega_menu',
    'before_widget' => '<div id="my-mega-menu-widget">',
    'after_widget' => '</div>',
    'before_title' => '',
    'after_title' => '',
    ));
    }
    Now edit the header.php file
    Find the location where you want to place the menu and add the following code to the header.php file:
    <?php /* Widgetized sidebar */
    if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('my_mega_menu') ) : ?><?php endif; ?>
    Save all the changes, and you should now be able to go into Appearances >> Widgets >> My_Mega_Menu_Widget and then drag the jquery_mega_menu widget into the my_mega_menu_widget box.

    Is there a restore option or am I looking at reinstalling the theme and recreating the site?

    my website address is http://www.designbydouglas.co.uk

  2. Jose Castaneda
    Member
    Posted 1 year ago #

    Just rename the theme's folder and it will revert back to the default theme.

    ps. I highly suggest you update your version of WordPress. ;)

  3. DESIGNbyDOUGLAS
    Member
    Posted 1 year ago #

    :-) I will if I manage to get in - new to this - will give that a try - thanks

  4. DESIGNbyDOUGLAS
    Member
    Posted 1 year ago #

    that hasn't worked unfortunately - I am using Custom Community by Themekraft and have renamed its folder custom-community-1 but still nothing?

  5. Evan Herman
    Member
    Posted 1 year ago #

    you can not just un-do what you have added?

  6. DESIGNbyDOUGLAS
    Member
    Posted 1 year ago #

    Yes I did but still have white screen - no error messages and when I inspect the element it looks as though the header isn't loading?

  7. DESIGNbyDOUGLAS
    Member
    Posted 1 year ago #

    Ok UPDATE

    can now get into wordpress admin and view pages etc but as soon as I choose 'view page' or 'visit site' I am still presented with a white screen.

  8. DESIGNbyDOUGLAS
    Member
    Posted 1 year ago #

    Still No Joy - Have deleted and re-installed theme to no avail - tech support not able to offer coding assistance other than the following error message....

    Parse error: syntax error, unexpected '}' in /home2/designb2/public_html/wp-content/themes/custom-community/functions.php on line 412

    ...Which when I check the coding there isn't even a '{' on that line!!!!

    I can see my content (pages, posts etc) in the wordpress side but only a white screen online. I am about to rebuild my entire site just because of a rouge '{'................someone must know how to fix this :-(

    Any Id

Topic Closed

This topic has been closed to new replies.

About this Topic