Title: I was playing with functions.php
Last modified: August 20, 2016

---

# I was playing with functions.php

 *  [picking_functions](https://wordpress.org/support/users/picking_functions/)
 * (@picking_functions)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/i-was-playing-with-functionsphp/)
 * Hello all
 * I was wondering if there is anyone who can help me. I made a big mistake playing
   with functions.php and maybe header.php theme files. Now my website is down, 
   displaying only error: Parse error: syntax error, unexpected ‘<‘ in /home/lampgov/
   public_html/wp-content/themes/lamp/functions.php on line 118
 * I tried to upload original functions.php and header.php files from the Theme 
   to FTP, but no luck. I can’t login neither can view the site.
 * Only acces I now have is the FTP.
 * Any advice would be much appreciated?

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

 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/i-was-playing-with-functionsphp/#post-3032868)
 * > I tried to upload original functions.php and header.php files from the Theme
   > to FTP, but no luck. I can’t login neither can view the site.
 * Try downloading your theme from the server and replacing it with a fresh copy
   by using [FTP](http://codex.wordpress.org/FTP_Clients) or whatever file management
   application your host provides.
 * Also try:
    – [resetting the plugins folder](http://codex.wordpress.org/FAQ_Troubleshooting#How_to_deactivate_all_plugins_when_not_able_to_access_the_administrative_menus.3F)
   by using [FTP](http://codex.wordpress.org/FTP_Clients) or whatever file management
   application your host provides. Sometimes, an apparently inactive plugin can 
   still cause problems.
 * – switching to the default theme (twenty eleven) by renaming your current theme’s
   folder in wp-content/themes using [FTP](http://codex.wordpress.org/FTP_Clients)
   or whatever file management application your host provides.
 *  Thread Starter [picking_functions](https://wordpress.org/support/users/picking_functions/)
 * (@picking_functions)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/i-was-playing-with-functionsphp/#post-3032873)
 * Thank you for your reply. I have tried both of solutions, but still no luck. 
   Nothing changes.
 * Here is the code of the functions.php file in question:
 *     ```
       <?php
       /* Load the tfuse class. */
       require_once( TEMPLATEPATH . '/library/tfuse.php' );
   
       /* Initialize the tfuse framework. */
       $tfuse = new tfuse();
       $tfuse->init();
   
       define( 'PREFIX', $tfuse->prefix );
   
       @$style = $_GET['color'];
   
       $styles_directory = get_template_directory()."/styles/";
       $styles_directory_uri = get_template_directory_uri()."/styles/";
   
       if( is_file( $styles_directory . $style .'.css' ) ) { 
   
       	//update_option(PREFIX.'_alt_stylesheet',$style.".css");
       	setcookie(PREFIX . '_style_demo', $style.".css", time()+3600, '/');
       }
   
       if( !empty($_GET['bg']) && is_file( get_template_directory().'/images/'.esc_attr($_GET['bg']) ) )
       {
           @setcookie(PREFIX . '_style_demo', esc_attr($_GET['bg']), time()+3600*60, '/');
       }
       # This sets the HTML Editor as default #
       add_filter( 'wp_default_editor', create_function('', 'return "html";') );
   
       add_filter('themefuse_shortcodes', 'do_shortcode');
       add_filter('widget_text', 'do_shortcode');
   
       //add_theme_support( 'post-thumbnails' );
   
       // Disable Admin Bar for all users
       add_filter('show_admin_bar', '__return_false');
   
       function improved_trim_excerpt($text) {
       	$raw_excerpt = $text;
       	if ( '' == $text ) {
       		$text = get_the_content('');
   
       		$text = strip_shortcodes( $text );
   
       		$text = apply_filters('the_content', $text);
       		$text = preg_replace('@<script[^>]*?>.*?</script>@si', '', $text);
       		$text = str_replace(']]>', ']]>', $text);
       		$text = strip_tags($text, '<a>');
       		$excerpt_length = apply_filters('excerpt_length', 25);
       		$excerpt_more = apply_filters('excerpt_more', ' ...' . '');
       		$words = explode(' ', $text, $excerpt_length + 1);
       		if (count($words) > $excerpt_length) {
       			array_pop($words);
       			$text = implode(' ', $words);
       			$text = $text . $excerpt_more;
       		}
       	}
       	return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);
       }
   
       remove_filter('get_the_excerpt', 'wp_trim_excerpt');
       add_filter('get_the_excerpt', 'improved_trim_excerpt');
   
       $_settings = get_option('newsletter_settings') ? get_option('newsletter_settings') : array();
   
       function add_email( $email ){
   
       	global $_settings;
   
       	$emails = explode(",", $email);
       	$valid_emails = array();
       	$unique_emails = array();
   
       	foreach($emails as $mail){
       		if ( is_email(trim($mail)) ) $valid_emails[] = trim($mail);
       	}
   
       	if ( empty($valid_emails) ) return false;
   
       	$valid_emails_string = implode(",", $valid_emails);
       	if ( !empty($_settings['newsletter_emails']) ) $valid_emails_string = ',' . $valid_emails_string;
   
       	$_settings['newsletter_emails'] .= $valid_emails_string;
       	$unique_emails = explode(",", $_settings['newsletter_emails']);
       	$unique_emails = array_unique($unique_emails);
   
       	$_settings['newsletter_emails'] = implode(",", $unique_emails);
       	_save_settings_todb();
   
       	return true;
       }
   
       function _save_settings_todb($form_settings = '')
       {
       	global $_settings;
   
       	if ( $form_settings <> '' ) {
       		unset($form_settings['newsletter_settings_saved']);
   
       		$emails = $_settings['newsletter_emails'];
   
       		$_settings = $form_settings;
       		$_settings['newsletter_emails'] = $emails;
       	}
       	update_option('newsletter_settings', $_settings);
       }
   
       if ( isset($_POST['newsletter']) ) add_email( $_POST['newsletter'] );
   
       if (!function_exists('tfuse_comment_reply')) {
       	function tfuse_comment_reply() {
       		if ( is_singular() ) wp_enqueue_script( 'comment-reply' );
       	}
       }
       add_action('get_header', 'tfuse_comment_reply');
   
       ?>
       ```
   
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/i-was-playing-with-functionsphp/#post-3032877)
 * Can we have a link to your site?
 *  Thread Starter [picking_functions](https://wordpress.org/support/users/picking_functions/)
 * (@picking_functions)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/i-was-playing-with-functionsphp/#post-3032881)
 * [http://www.lamp.gov.me](http://www.lamp.gov.me)
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/i-was-playing-with-functionsphp/#post-3032887)
 * I think you’re still using the lamp theme.
    Have you tried?
 * – switching to the default theme by renaming your current theme’s folder (lamp)
   in wp-content/themes using [FTP](http://codex.wordpress.org/FTP_Clients) or whatever
   file management application your host provides.
 *  Thread Starter [picking_functions](https://wordpress.org/support/users/picking_functions/)
 * (@picking_functions)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/i-was-playing-with-functionsphp/#post-3032891)
 * I have renamed “twentyeleven” folder in “lamp” and thigs are the same.
    I have
   renamed “lamp” in “twentyeleven”, still the same. Even now I don’t have a “lamp”
   folder name. Check it out? Whatever I try, still get the same parse error..
 *  Thread Starter [picking_functions](https://wordpress.org/support/users/picking_functions/)
 * (@picking_functions)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/i-was-playing-with-functionsphp/#post-3032892)
 * And yes, uploading fresh copy of the theme and replacing those files, didn’t 
   help either. I thought it would recover it, whatever it may be. Very strange..
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/i-was-playing-with-functionsphp/#post-3032905)
 * > I have renamed “twentyeleven” folder in “lamp” and things are the same.
 * Don’t rename the twentyeleven theme folder, you only need to rename the lamp 
   folder.
 *  Thread Starter [picking_functions](https://wordpress.org/support/users/picking_functions/)
 * (@picking_functions)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/i-was-playing-with-functionsphp/#post-3032909)
 * It is renamed, and “twentyeleven” is still there.
 *  Thread Starter [picking_functions](https://wordpress.org/support/users/picking_functions/)
 * (@picking_functions)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/i-was-playing-with-functionsphp/#post-3032911)
 * I have managed to solve this. Simply by trying to upload and replace corrupted
   functions.php file again…
 * Thank you very much for your support, keesiemeijer!
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/i-was-playing-with-functionsphp/#post-3032912)
 * That’s strange because I can still see it here as part of the url.
    [http://www.lamp.gov.me/wp-content/themes/lamp/style.css](http://www.lamp.gov.me/wp-content/themes/lamp/style.css)
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/i-was-playing-with-functionsphp/#post-3032916)
 * Ah, that would explain it. 🙂
 * I’m glad you got it solved.

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

The topic ‘I was playing with functions.php’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 12 replies
 * 2 participants
 * Last reply from: [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * Last activity: [13 years, 10 months ago](https://wordpress.org/support/topic/i-was-playing-with-functionsphp/#post-3032916)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
