Then add the following code into header.php to pickup the custom field if it was a single post and the custom field was present.
< ?php if( is_single() and $singlePostJs = get_post_meta($post->ID, 'single-post-js', true) ) echo $singlePostJs; ?>
That’s it! It’s working!
The following jQuery code has been included for this post only. The reason for including the script tags inside the custom field and not in the PHP is that I can also use this field for CSS, but should probably create another custom field to manage that. Your choice.
Just do a quick check on other posts and pages without the custom field and check they are not affected by the new field. Hope this helped you!