The correct way to pass PHP variables to Javascript is using wp_localize_script .
Mark Otto's article . And this is Q&A in WordPress StackExghange .
In your Question, you are not showing where these variables come from, so they print ... nothing.
I just did a test. This creates parameter values ββin the database.
add_action( 'init', 'so_13282503_init' ); function so_13282503_init() { if( !get_option('pause_time') ) { update_option('pause_time', '50'); update_option('transition_effect', 'elastic.easeIn'); update_option('transition_speed', '400'); update_option('auto_advance', '4'); } }
And this is an adapted version of your code:
add_action( 'wp_head', 'slideshowSettings' ); function slideshowSettings () { $pause_time = get_option('pause_time'); $transition_effect = get_option('transition_effect'); $transition_speed = get_option('transition_speed'); $auto_advance = get_option('auto_advance'); $code = "<script> jQuery(function(){ jQuery('#camera_wrap_3').camera({ height: '40%', thumbnails: true, time: ".$pause_time.", fx: '".$transition_effect."', transPeriod: ".$transition_speed.", autoAdvance: ".$auto_advance.", minHeight: '50px', mobileNavHover: false }); }); </script> "; echo $code; }
As a result, this is printed in the <head> site:

source share