• Resolved ktkreitman

    (@ktkreitman)


    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

    (@ktkreitman)

    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.

    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. 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 may help.

    Thread Starter ktkreitman

    (@ktkreitman)

    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.