Title: functions.php and swf code
Last modified: August 21, 2016

---

# functions.php and swf code

 *  Resolved [ktkreitman](https://wordpress.org/support/users/ktkreitman/)
 * (@ktkreitman)
 * [12 years ago](https://wordpress.org/support/topic/functionsphp-and-swf-code/)
 * Hey friends,
 * So I’m having some trouble. I wanted to add a .swf file to my website. I followed
   one forum and used this code:
 * function demo($mimes) {
    if ( function_exists( ‘current_user_can’ ) ) $unfiltered
   = $user ? user_can( $user, ‘unfiltered_html’ ) : current_user_can( ‘unfiltered_html’);
   if ( !empty( $unfiltered ) ) { $mimes[‘swf’] = ‘application/x-shockwave-flash’;}
   return $mimes; } add_filter(‘upload_mimes’,’demo’);
 * And I tried to remove it from the functions.php file and now I get this error.
 * Parse error: syntax error, unexpected ‘}’ in /home/ktkreitman/public_html/wp-
   content/themes/temptation/functions.php on line 12
 * I even re-added the functions.php file from the original and I still get the 
   same error.
 * Any help?

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

 *  Thread Starter [ktkreitman](https://wordpress.org/support/users/ktkreitman/)
 * (@ktkreitman)
 * [12 years ago](https://wordpress.org/support/topic/functionsphp-and-swf-code/#post-4968303)
 * I also can’t do anything at all. I’m stuck on the page that I was editing the
   functions.php file.
 * I can’t view my website or click on any of the other links.
 *  [Peter Lawrenson](https://wordpress.org/support/users/lorro/)
 * (@lorro)
 * [12 years ago](https://wordpress.org/support/topic/functionsphp-and-swf-code/#post-4968420)
 * I hope you have a recent backup.
 * Looks like you’ve corrupted your theme files somehow. Instead of trying to debug
   it, switch to the default TwentyFourteen theme, delete the wp-content/themes/
   direction directory, and re-upload the theme. Your settings are in the database,
   not the theme files, so will be unaffected.
 * When its working, setup a [child theme](http://codex.wordpress.org/Child_Themes).
   Put your new function in a functions.php in the child theme. The child theme 
   functions.php is executed as well as and after the parent theme functions.php.
   In future, you can update your parent theme without affecting your customisation.
 * If your PHP is a bit shaky, a [syntax checker](http://www.piliapp.com/php-syntax-check/)
   may help.
 *  Thread Starter [ktkreitman](https://wordpress.org/support/users/ktkreitman/)
 * (@ktkreitman)
 * [12 years ago](https://wordpress.org/support/topic/functionsphp-and-swf-code/#post-4968423)
 * Thanks so much! I was able to figure it out!

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

The topic ‘functions.php and swf code’ is closed to new replies.

## Tags

 * [functions](https://wordpress.org/support/topic-tag/functions/)
 * [parse-error](https://wordpress.org/support/topic-tag/parse-error/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [ktkreitman](https://wordpress.org/support/users/ktkreitman/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/functionsphp-and-swf-code/#post-4968423)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
