• [ Moderator note: moved to How-to and Troubleshooting. ]

    I inserted this code to make users return to homepage upon logging out:

    add_action(‘wp_logout’,’go_home’);
    function go_home(){
    wp_redirect( home_url() );
    exit();
    }

    I inserted it at the end of the theme functions section, saved it and it worked great. Then I fooled with it to see if I could duplicate the function for logging in, and when I saved it again I got this:

    Fatal error: Cannot redeclare go_home() (previously declared in /home1/accountadmin/public_html/wp-content/themes/mh_newsdesk/functions.php:124) in /home1/accountadmin/public_html/wp-content/themes/mh_newsdesk/functions.php on line 132

    So I deleted all the code, making the file exactly as it was before I touched it, and when I tried to resave I got the same error. Now there is no way to access anything to do with the site or my dashboard without getting that error!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Could be a caching issues, is it still erroring out?

    Thread Starter John0987654321

    (@john0987654321)

    Thanks for the reply. It was a problem with the theme, or with conflicting plugins. I had to go to the hosting service and have them reset the theme to default and then reupload and delete the suspect plugins.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Site crashing’ is closed to new replies.