Title: HTTP ERROR 500 After adding theme-customizer.js to functions.php
Last modified: August 31, 2016

---

# HTTP ERROR 500 After adding theme-customizer.js to functions.php

 *  [Manteli](https://wordpress.org/support/users/manteli/)
 * (@manteli)
 * [10 years ago](https://wordpress.org/support/topic/http-error-500-after-adding-theme-customizerjs-to-functionsphp/)
 * Hello
 * After I added theme-customizer.js to the functions.php I started to get black
   HTTP ERROR 500 on every page on my blog.
 * theme-customizer.js looks like this:
 *     ```
       /**
        * This file adds some LIVE to the Theme Customizer live preview. To leverage
        * this, set your custom settings to 'postMessage' and then add your handling
        * here. Your javascript should grab settings from customizer controls, and
        * then make any necessary changes to the page using jQuery.
        */
       ( function( $ ) {
   
       	// Update the site title in real time...
       	wp.customize( 'blogname', function( value ) {
       		value.bind( function( newval ) {
       			$( '#site-title a' ).html( newval );
       		} );
       	} );
   
       	//Update the site description in real time...
       	wp.customize( 'blogdescription', function( value ) {
       		value.bind( function( newval ) {
       			$( '.site-description' ).html( newval );
       		} );
       	} );
   
       	//Update site link color in real time...
       	wp.customize( 'h1_header_color', function( value ) {
       		value.bind( function( newval ) {
       			$('h1 a').css('color', newval );
       		} );
       	} );
   
       } )( jQuery );
       ```
   
 * Adding theme-customizer.js to functions.php
 *     ```
       /**
            * Used by hook: 'customize_preview_init'
            *
            * @see add_action('customize_preview_init',$func)
            */
           public static function hello_customizer_live_preview()
           {
               wp_enqueue_script(
                     'hello-themecustomizer',			//Give the script an ID
                     get_template_directory_uri().'/js/theme-customizer.js',//Point to file
                     array( 'jquery','customize-preview' ),	//Define dependencies
                     '',						//Define a version (optional)
                     true						//Put script in footer?
               );
           }
           add_action( 'customize_preview_init', 'hello_customizer_live_preview' );
       ```
   
 * When I remove the code above, the error disappears. What am I doing wrong?

The topic ‘HTTP ERROR 500 After adding theme-customizer.js to functions.php’ is 
closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [Manteli](https://wordpress.org/support/users/manteli/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/http-error-500-after-adding-theme-customizerjs-to-functionsphp/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
