Since WordPress 4.5, you can add the inline JavaScript using the wp_add_inline_script()
function. This can be used instead of echoing inline scripts using wp_footer
. The first argument is the handle of a registered script, in this case 'pretty-photo'.
function add_styles_scripts(){
// Add script in the footer
wp_enqueue_script('pretty-photo', get_stylesheet_directory_uri() . '/.../jquery.prettyPhoto.js',
array('jquery'), NULL, true);